1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-15 09:04:04 +02:00
joplin/packages/app-mobile/commands/openNote.ts

19 lines
548 B
TypeScript

import { CommandRuntime, CommandDeclaration, CommandContext } from '@joplin/lib/services/CommandService';
import Logger from '@joplin/utils/Logger';
import goToNote from './util/goToNote';
const logger = Logger.create('openNoteCommand');
export const declaration: CommandDeclaration = {
name: 'openNote',
};
export const runtime = (): CommandRuntime => {
return {
execute: async (_context: CommandContext, noteId: string, hash: string = null) => {
logger.info(`Navigating to note ${noteId}`);
await goToNote(noteId, hash);
},
};
};