mirror of
https://github.com/wavetermdev/wails.git
synced 2026-08-05 13:53:43 -07:00
Revert bootstrapping.
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -1,6 +1,7 @@
|
||||
import resolve from '@rollup/plugin-node-resolve';
|
||||
// import commonjs from '@rollup/plugin-commonjs';
|
||||
import svelte from 'rollup-plugin-svelte';
|
||||
import { terser } from "rollup-plugin-terser";
|
||||
|
||||
export default [
|
||||
// browser-friendly UMD build
|
||||
@@ -28,6 +29,7 @@ export default [
|
||||
}),
|
||||
resolve({browser: true}), // so Rollup can find `ms`
|
||||
// commonjs() // so Rollup can convert `ms` to an ES module
|
||||
terser(),
|
||||
]
|
||||
},
|
||||
|
||||
|
||||
@@ -17,9 +17,6 @@ let websocket = null;
|
||||
let callback = null;
|
||||
let connectTimer;
|
||||
|
||||
let firstConnect = true;
|
||||
|
||||
|
||||
export function StartWebsocket(userCallback) {
|
||||
|
||||
callback = userCallback;
|
||||
@@ -57,30 +54,12 @@ function setupIPCBridge() {
|
||||
|
||||
// Handles incoming websocket connections
|
||||
function handleConnect() {
|
||||
if( firstConnect ) return initialConnection();
|
||||
return reconnect();
|
||||
}
|
||||
|
||||
// Handles initial websocket connection
|
||||
function initialConnection() {
|
||||
log('Connected to backend');
|
||||
setupIPCBridge();
|
||||
hideOverlay();
|
||||
clearInterval(connectTimer);
|
||||
websocket.onclose = handleDisconnect;
|
||||
websocket.onmessage = handleMessage;
|
||||
firstConnect = false;
|
||||
|
||||
// TODO: Ask to be bootstrapped
|
||||
}
|
||||
|
||||
// Handles reconnect
|
||||
function reconnect() {
|
||||
log('Reconnected to backend');
|
||||
hideOverlay();
|
||||
clearInterval(connectTimer);
|
||||
websocket.onclose = handleDisconnect;
|
||||
websocket.onmessage = handleMessage;
|
||||
}
|
||||
|
||||
// Handles websocket disconnects
|
||||
|
||||
Reference in New Issue
Block a user