fixes mac openlinks
This commit is contained in:
parent
102665ac62
commit
228ac287cc
1 changed files with 14 additions and 1 deletions
|
@ -2,7 +2,6 @@
|
||||||
import '@babel/polyfill';
|
import '@babel/polyfill';
|
||||||
import keytar from 'keytar';
|
import keytar from 'keytar';
|
||||||
import SemVer from 'semver';
|
import SemVer from 'semver';
|
||||||
import url from 'url';
|
|
||||||
import https from 'https';
|
import https from 'https';
|
||||||
import { app, dialog, ipcMain, session, shell } from 'electron';
|
import { app, dialog, ipcMain, session, shell } from 'electron';
|
||||||
import { autoUpdater } from 'electron-updater';
|
import { autoUpdater } from 'electron-updater';
|
||||||
|
@ -191,6 +190,20 @@ app.on('will-quit', event => {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
app.on('will-finish-launching', () => {
|
||||||
|
// Protocol handler for macOS
|
||||||
|
app.on('open-url', (event, URL) => {
|
||||||
|
event.preventDefault();
|
||||||
|
|
||||||
|
if (rendererWindow) {
|
||||||
|
rendererWindow.webContents.send('open-uri-requested', URL);
|
||||||
|
rendererWindow.show();
|
||||||
|
} else {
|
||||||
|
appState.macDeepLinkingURI = URL;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
app.on('before-quit', () => {
|
app.on('before-quit', () => {
|
||||||
appState.isQuitting = true;
|
appState.isQuitting = true;
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Reference in a new issue