Revert bootstrapping.

This commit is contained in:
Lea Anthony
2021-02-12 15:08:54 +11:00
parent 354429bc28
commit 9a81a57d13
3 changed files with 3 additions and 22 deletions
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