diff --git a/src/App.tsx b/src/App.tsx index 59a75529..19225e20 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -14,6 +14,7 @@ import { useVaultLoader } from './hooks/useVaultLoader' import { useSettings } from './hooks/useSettings' import { useNoteActions, generateUntitledName } from './hooks/useNoteActions' import { useAppKeyboard } from './hooks/useAppKeyboard' +import { useViewMode } from './hooks/useViewMode' import { useEntryActions } from './hooks/useEntryActions' import { isTauri } from './mock-tauri' import { useKeyboardNavigation } from './hooks/useKeyboardNavigation' @@ -129,6 +130,8 @@ function App() { notes.handleRenameNote(path, newTitle, vaultPath, vault.replaceEntry) }, [notes, vaultPath, vault]) + const { setViewMode } = useViewMode() + useAppKeyboard({ onQuickOpen: () => setShowQuickOpen(true), onCreateNote: handleCreateNoteImmediate, @@ -136,6 +139,7 @@ function App() { onOpenSettings: () => setShowSettings(true), onTrashNote: entryActions.handleTrashNote, onArchiveNote: entryActions.handleArchiveNote, + onSetViewMode: setViewMode, activeTabPathRef: notes.activeTabPathRef, handleCloseTabRef: notes.handleCloseTabRef, }) diff --git a/src/components/NoteList.tsx b/src/components/NoteList.tsx index 99affcc3..0d8d633c 100644 --- a/src/components/NoteList.tsx +++ b/src/components/NoteList.tsx @@ -185,7 +185,7 @@ function useNoteListData({ entries, selection, allContent, query, listSort, list const searched = useMemo(() => { if (isEntityView) return [] - const sorted = [...filterEntries(entries, selection, modifiedFiles)].sort(getSortComparator(listSort, listDirection)) + const sorted = [...filterEntries(entries, selection)].sort(getSortComparator(listSort, listDirection)) return filterByQuery(sorted, query) }, [entries, selection, modifiedFiles, isEntityView, listSort, listDirection, query])