Skip to content

Commit

Permalink
deep-linking: Redirect in Linux when app open
Browse files Browse the repository at this point in the history
  • Loading branch information
kanishk98 committed May 19, 2019
1 parent 13c2601 commit 7d60782
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
7 changes: 4 additions & 3 deletions app/main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,12 @@ const mainURL = 'file://' + path.join(__dirname, '../renderer', 'main.html');
const singleInstanceLock = app.requestSingleInstanceLock();
if (singleInstanceLock) {
app.on('second-instance', (event, argv) => {
// uri scheme handler for windows
if (process.platform === 'win32') {
// uri scheme handler for windows and linux
if (process.platform !== 'darwin') {
deepLinkingUrl = argv.slice(1);
if (mainWindow) {
mainWindow.webContents.send('deep-linking-url', deepLinkingUrl[isDev ? 1 : 0]);
mainWindow.webContents.focus();
mainWindow.webContents.send('deep-linking-url', deepLinkingUrl[(isDev && process.platform === 'win32') ? 1 : 0]);
}
}

Expand Down
6 changes: 6 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@
"!docs${/*}",
"!node_modules/@paulcbetts/cld/deps/cld${/*}"
],
"protocols": [
{
"name": "Zulip",
"schemes": ["zulip"]
}
],
"copyright": "©2019 Kandra Labs, Inc.",
"mac": {
"category": "public.app-category.productivity",
Expand Down

0 comments on commit 7d60782

Please sign in to comment.