initialize auto updater once per window, not per tab

This commit is contained in:
Guillermo Rauch 2016-07-07 16:22:45 -07:00
parent c3f8e81a5c
commit 1383775fbe

View file

@ -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 });
});