fix: callback methods
This commit is contained in:
@@ -20,8 +20,8 @@ type Props = {
|
|||||||
|
|
||||||
export const NotesList: FunctionComponent<Props> = observer(
|
export const NotesList: FunctionComponent<Props> = observer(
|
||||||
({ application, appState, notes, selectedNotes, displayOptions, paginate }) => {
|
({ application, appState, notes, selectedNotes, displayOptions, paginate }) => {
|
||||||
const selectNextNote = useCallback(() => appState.notesView.selectNextNote, [appState])
|
const selectNextNote = useCallback(() => appState.notesView.selectNextNote(), [appState])
|
||||||
const selectPreviousNote = useCallback(() => appState.notesView.selectPreviousNote, [appState])
|
const selectPreviousNote = useCallback(() => appState.notesView.selectPreviousNote(), [appState])
|
||||||
|
|
||||||
const { hideTags, hideDate, hideNotePreview, hideEditorIcon, sortBy } = displayOptions
|
const { hideTags, hideDate, hideNotePreview, hideEditorIcon, sortBy } = displayOptions
|
||||||
|
|
||||||
|
|||||||
@@ -41,12 +41,12 @@ export const NotesView: FunctionComponent<Props> = observer(({ application, appS
|
|||||||
panelWidth,
|
panelWidth,
|
||||||
} = appState.notesView
|
} = appState.notesView
|
||||||
|
|
||||||
const createNewNote = useCallback(() => appState.notesView.createNewNote, [appState])
|
const createNewNote = useCallback(() => appState.notesView.createNewNote(), [appState])
|
||||||
const onFilterEnter = useCallback(() => appState.notesView.onFilterEnter, [appState])
|
const onFilterEnter = useCallback(() => appState.notesView.onFilterEnter(), [appState])
|
||||||
const clearFilterText = useCallback(() => appState.notesView.clearFilterText, [appState])
|
const clearFilterText = useCallback(() => appState.notesView.clearFilterText(), [appState])
|
||||||
const setNoteFilterText = useCallback((text: string) => appState.notesView.setNoteFilterText(text), [appState])
|
const setNoteFilterText = useCallback((text: string) => appState.notesView.setNoteFilterText(text), [appState])
|
||||||
const selectNextNote = useCallback(() => appState.notesView.selectNextNote, [appState])
|
const selectNextNote = useCallback(() => appState.notesView.selectNextNote(), [appState])
|
||||||
const selectPreviousNote = useCallback(() => appState.notesView.selectPreviousNote, [appState])
|
const selectPreviousNote = useCallback(() => appState.notesView.selectPreviousNote(), [appState])
|
||||||
|
|
||||||
const [showDisplayOptionsMenu, setShowDisplayOptionsMenu] = useState(false)
|
const [showDisplayOptionsMenu, setShowDisplayOptionsMenu] = useState(false)
|
||||||
const [focusedSearch, setFocusedSearch] = useState(false)
|
const [focusedSearch, setFocusedSearch] = useState(false)
|
||||||
@@ -64,7 +64,7 @@ export const NotesView: FunctionComponent<Props> = observer(({ application, appS
|
|||||||
modifiers: [KeyboardModifier.Meta, KeyboardModifier.Ctrl],
|
modifiers: [KeyboardModifier.Meta, KeyboardModifier.Ctrl],
|
||||||
onKeyDown: (event) => {
|
onKeyDown: (event) => {
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
createNewNote()
|
void createNewNote()
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user