diff --git a/src/hooks/useNote.hook.ts b/src/hooks/useNote.hook.ts index b6f466e..0ce6cd1 100644 --- a/src/hooks/useNote.hook.ts +++ b/src/hooks/useNote.hook.ts @@ -13,17 +13,19 @@ export const useNote = (containerClass: string) => { const { isMobile } = useOverlay(false) const { stackedNotes, addStackedNote } = useRouteQueryStackedNotes() - const titles = computed(() => - stackedNotes.value?.reduce((obj: Record, note) => { - if (!note) { + const titles = computed( + () => + stackedNotes.value?.reduce((obj: Record, note) => { + if (!note) { + return obj + } + const filePath = + store.files.find((file) => file.sha === note)?.path ?? '' + + obj[note] = pathToNotePathTitle(filePath) + return obj - } - const filePath = store.files.find((file) => file.sha === note)?.path ?? '' - - obj[note] = pathToNotePathTitle(filePath) - - return obj - }, {}) + }, {}) ) const unsubscribeLink = noteEventBus.addEventBusListener(