mirror of
https://github.com/quine-global/hyper.git
synced 2026-01-13 04:28: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 rpc = createRPC(win);
|
||||||
const sessions = new Map();
|
const sessions = new Map();
|
||||||
|
|
||||||
|
// config changes
|
||||||
const cfgUnsubscribe = config.subscribe(() => {
|
const cfgUnsubscribe = config.subscribe(() => {
|
||||||
win.webContents.send('config change');
|
win.webContents.send('config change');
|
||||||
});
|
});
|
||||||
|
|
||||||
rpc.on('init', () => {
|
rpc.on('init', () => {
|
||||||
win.show();
|
win.show();
|
||||||
|
|
||||||
|
// auto updates
|
||||||
|
if (!isDev) {
|
||||||
|
AutoUpdater(rpc);
|
||||||
|
} else {
|
||||||
|
console.log('ignoring auto updates during dev');
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
rpc.on('new', ({ rows = 40, cols = 100 }) => {
|
rpc.on('new', ({ rows = 40, cols = 100 }) => {
|
||||||
|
|
@ -68,12 +77,6 @@ app.on('ready', () => {
|
||||||
sessions.set(uid, session);
|
sessions.set(uid, session);
|
||||||
rpc.emit('new session', { uid });
|
rpc.emit('new session', { uid });
|
||||||
|
|
||||||
if (!isDev) {
|
|
||||||
AutoUpdater(rpc);
|
|
||||||
} else {
|
|
||||||
console.log('ignoring auto updates during dev');
|
|
||||||
}
|
|
||||||
|
|
||||||
session.on('data', (data) => {
|
session.on('data', (data) => {
|
||||||
rpc.emit('data', { uid, data });
|
rpc.emit('data', { uid, data });
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue