From 4eddd477969b22c7dd10dfe79071cead8706e067 Mon Sep 17 00:00:00 2001 From: Julien Calixte Date: Tue, 16 Mar 2021 22:16:36 +0100 Subject: [PATCH] :bug: (link) add a relative path to do: create a resolve path system --- src/hooks/useNote.hook.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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)