mirror of
https://github.com/quine-global/hyper.git
synced 2026-01-12 20:18:41 -09:00
initialize auto updater once per window, not per tab
This commit is contained in:
parent
c3f8e81a5c
commit
1383775fbe
1 changed files with 9 additions and 6 deletions
15
index.js
15
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 });
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue