1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-11-24 08:12:24 +02:00

Desktop: Fixes #7354: Open callback URLs from within the application

This commit is contained in:
Laurent Cozic 2022-11-28 18:01:00 +01:00
parent fab2271c9f
commit 6ece7f4c1b

View File

@ -16,8 +16,13 @@ export const runtime = (): CommandRuntime => {
if (!link) throw new Error('Link cannot be empty');
if (link.startsWith('joplin://') || link.startsWith(':/')) {
const { itemId, hash } = parseResourceUrl(link);
await openItemById(itemId, context.dispatch, hash);
const parsedUrl = parseResourceUrl(link);
if (parsedUrl) {
const { itemId, hash } = parsedUrl;
await openItemById(itemId, context.dispatch, hash);
} else {
void require('electron').shell.openExternal(link);
}
} else if (urlProtocol(link)) {
if (link.indexOf('file://') === 0) {
// When using the file:// protocol, openPath doesn't work (does