diff --git a/src/hooks/useNote.hook.ts b/src/hooks/useNote.hook.ts index a163c22..b7f4bd4 100644 --- a/src/hooks/useNote.hook.ts +++ b/src/hooks/useNote.hook.ts @@ -75,7 +75,11 @@ export const useNote = ( ? `${sanitizePath(absolutePath)}/${sanitizePath(path)}` : sanitizePath(path) - const file = tree.value.find((file) => file.path === finalPath) + const relativePath = sanitizePath(path) + + const file = tree.value.find( + (file) => file.path === finalPath || file.path === relativePath + ) if (!file?.sha || stackedNotes.value.includes(file.sha)) { scrollToFocusedNote(file?.sha, stackedNotes.value)