Skip to content

Commit

Permalink
Mobile: Fixes laurent22#11384: Fix switching notes then unloading app…
Browse files Browse the repository at this point in the history
… causes blank screen

This issue is caused by `Notes.tsx` removing the current note from
`state.notes` (due to not being in the current parent item). This
then causes the editor to unload.

This change needs:
- Manual testing
  • Loading branch information
personalizedrefrigerator committed Nov 12, 2024
1 parent 50b16c6 commit 997e5f5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/app-mobile/commands/util/goToNote.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@ 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))) {
const note = await Note.load(id);
if (!note) {
throw new Error(`No note with id ${id}`);
}

return NavService.go('Note', {
noteId: id,
noteHash: hash,
folderId: note.parent_id,
});
};

Expand Down

0 comments on commit 997e5f5

Please sign in to comment.