fix: error when clicking LBRY URL when app is closed (https://github.com/lbryio/lbry-app/issues/1119)

Fix https://github.com/lbryio/lbry-app/issues/1119
This commit is contained in:
Igor Gassmann 2018-03-19 16:51:57 -04:00
parent 034398859e
commit e6e8218095
2 changed files with 9 additions and 2 deletions

View file

@ -43,6 +43,8 @@ export default appState => {
// - In a URI with a claim ID, like lbry://channel#claimid, Windows interprets the hash mark as
// an anchor and converts it to lbry://channel/#claimid. We remove the slash here as well.
deepLinkingURI = process.argv[1].replace(/\/$/, '').replace('/#', '#');
} else if (process.platform === 'darwin') {
deepLinkingURI = appState.macDeepLinkingURI;
}
setupBarMenu();

View file

@ -110,8 +110,13 @@ app.on('will-finish-launching', () => {
// Protocol handler for macOS
app.on('open-url', (event, URL) => {
event.preventDefault();
rendererWindow.webContents.send('open-uri-requested', URL);
rendererWindow.show();
if (rendererWindow) {
rendererWindow.webContents.send('open-uri-requested', URL);
rendererWindow.show();
} else {
appState.macDeepLinkingURI = URL;
}
});
});