diff --git a/index.js b/index.js index 7088dc29..092f5f0c 100644 --- a/index.js +++ b/index.js @@ -55,12 +55,21 @@ app.on('ready', () => { const rpc = createRPC(win); const sessions = new Map(); + + // config changes const cfgUnsubscribe = config.subscribe(() => { win.webContents.send('config change'); }); rpc.on('init', () => { win.show(); + + // auto updates + if (!isDev) { + AutoUpdater(rpc); + } else { + console.log('ignoring auto updates during dev'); + } }); rpc.on('new', ({ rows = 40, cols = 100 }) => { @@ -68,12 +77,6 @@ app.on('ready', () => { sessions.set(uid, session); rpc.emit('new session', { uid }); - if (!isDev) { - AutoUpdater(rpc); - } else { - console.log('ignoring auto updates during dev'); - } - session.on('data', (data) => { rpc.emit('data', { uid, data }); });