fix: wire useViewMode into App and fix filterEntries arity
This commit is contained in:
@@ -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,
|
||||
})
|
||||
|
||||
@@ -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])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user