mirror of https://github.com/laurent22/joplin.git
Add a function to check for valid callback url
parent
047883bd27
commit
f454c4e33b
|
@ -7,6 +7,7 @@ const Logger = require('@joplin/lib/Logger').default;
|
|||
const FsDriverNode = require('@joplin/lib/fs-driver-node').default;
|
||||
const envFromArgs = require('@joplin/lib/envFromArgs');
|
||||
const packageInfo = require('./packageInfo.js');
|
||||
const { isCallbackUrl } = require('@joplin/lib/ProtocolUtils');
|
||||
|
||||
// Electron takes the application name from package.json `name` and
|
||||
// displays this in the tray icon toolip and message box titles, however in
|
||||
|
@ -44,7 +45,7 @@ if (env === 'dev' && process.platform === 'win32') {
|
|||
electronApp.setAsDefaultProtocolClient('joplin');
|
||||
}
|
||||
|
||||
const initialUrl = process.argv.find((arg) => arg.startsWith('joplin://'));
|
||||
const initialUrl = process.argv.find((arg) => isCallbackUrl(arg));
|
||||
|
||||
const wrapper = new ElectronAppWrapper(electronApp, env, profilePath, isDebugMode, initialUrl);
|
||||
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
export function isCallbackUrl(s: string) {
|
||||
return s.startsWith('joplin://x-callback-url/');
|
||||
}
|
||||
|
||||
export function getNoteUrl(noteId: string) {
|
||||
return `joplin://x-callback-url/openNote?id=${noteId}`;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue