Skip to content
This repository has been archived by the owner on Feb 23, 2021. It is now read-only.

Add deeplink for messages #429

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/package.json
Expand Up @@ -11,4 +11,4 @@
"fs-jetpack": "^0.10.5",
"menubar": "^5.2.0"
}
}
}
14 changes: 14 additions & 0 deletions app/src/renderer.js
Expand Up @@ -254,6 +254,20 @@ onload = () => {
shell.openExternal(url);
});

app.setAsDefaultProtocolClient('goofy');
app.on('open-url', (event, url) => {
const parsedURL = new URL(url);
switch(parsedURL.pathname) {
case '//message': {
const id = parsedURL.searchParams.get('id');
if (id) {
webview.send(constants.JUMP_TO_CONVERATION, 'row_header_id_user:' + id);
}
break;
}
}
});

// Ensure focus propagates when the application is focused
const webviewFocusHandler = new FocusHandler(webview);
app.on('browser-window-focus', webviewFocusHandler);
Expand Down