Move open-url
handling to first instance block
This commit is contained in:
parent
21956ca27b
commit
5e30757d07
1 changed files with 8 additions and 12 deletions
20
app/main.ts
20
app/main.ts
|
@ -270,6 +270,14 @@ if (!process.mas) {
|
|||
}
|
||||
return true;
|
||||
});
|
||||
|
||||
app.on('open-url', (event, incomingHref) => {
|
||||
event.preventDefault();
|
||||
const route = parseSignalRoute(incomingHref);
|
||||
if (route != null) {
|
||||
handleSignalRoute(route);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
/* eslint-enable no-console */
|
||||
|
@ -2244,18 +2252,6 @@ app.on(
|
|||
app.setAsDefaultProtocolClient('sgnl');
|
||||
app.setAsDefaultProtocolClient('signalcaptcha');
|
||||
|
||||
app.on('will-finish-launching', () => {
|
||||
// open-url must be set from within will-finish-launching for macOS
|
||||
// https://stackoverflow.com/a/43949291
|
||||
app.on('open-url', (event, incomingHref) => {
|
||||
event.preventDefault();
|
||||
const route = parseSignalRoute(incomingHref);
|
||||
if (route != null) {
|
||||
handleSignalRoute(route);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
ipc.on(
|
||||
'set-badge',
|
||||
(_event: Electron.Event, badge: number | 'marked-unread') => {
|
||||
|
|
Loading…
Reference in a new issue