fixes mac openlinks

This commit is contained in:
Jessop Breth 2019-05-09 09:53:43 -04:00
parent 102665ac62
commit 228ac287cc

View file

@ -2,7 +2,6 @@
import '@babel/polyfill';
import keytar from 'keytar';
import SemVer from 'semver';
import url from 'url';
import https from 'https';
import { app, dialog, ipcMain, session, shell } from 'electron';
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', () => {
appState.isQuitting = true;
});