1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-12 08:54:00 +02:00
joplin/packages/app-mobile/commands/util/goToNote.ts

16 lines
336 B
TypeScript

import Note from '@joplin/lib/models/Note';
import NavService from '@joplin/lib/services/NavService';
const goToNote = async (id: string, hash?: string) => {
if (!(await Note.load(id))) {
throw new Error(`No note with id ${id}`);
}
return NavService.go('Note', {
noteId: id,
noteHash: hash,
});
};
export default goToNote;