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

16 lines
336 B
TypeScript
Raw Normal View History

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;