1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-03-26 21:12:59 +02:00
This commit is contained in:
Roman 2021-08-14 23:30:19 +01:00
parent 2386abea3e
commit 20d1f74ee4
2 changed files with 7 additions and 3 deletions

View File

@ -36,7 +36,7 @@ import ShareService from '@joplin/lib/services/share/ShareService';
import { reg } from '@joplin/lib/registry';
import removeKeylessItems from '../ResizableLayout/utils/removeKeylessItems';
import { localSyncInfoFromState } from '@joplin/lib/services/synchronizer/syncInfoUtils';
import { parseCallbackUrl } from '@joplin/lib/ProtocolUtils';
import { Command, parseCallbackUrl } from '@joplin/lib/ProtocolUtils';
import ElectronAppWrapper from '../../ElectronAppWrapper';
const { connect } = require('react-redux');
@ -203,7 +203,7 @@ class MainScreenComponent extends React.Component<Props, State> {
private openUrl(url: string) {
console.log(`openUrl ${url}`);
const { command, params } = parseCallbackUrl(url);
void CommandService.instance().execute(command, params.id);
void CommandService.instance().execute(Command[command], params.id);
}
private updateLayoutPluginViews(layout: LayoutItem, plugins: PluginStates) {

View File

@ -14,7 +14,11 @@ export function getTagUrl(tagId: string) {
return `joplin://x-callback-url/openTag?id=${encodeURIComponent(tagId)}`;
}
export type Command = 'openNote' | 'openFolder' | 'openTag';
export enum Command {
openNote = 'openNote',
openFolder = 'openFolder',
openTag = 'openTag',
}
export interface CallbackUrlInfo {
command: Command;