mirror of
https://github.com/laurent22/joplin.git
synced 2024-12-18 09:35:20 +02:00
16 lines
336 B
TypeScript
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;
|