From 18e68adbb00e02afcd5e2013dff7dc15bf5f8d69 Mon Sep 17 00:00:00 2001 From: Mo Date: Tue, 17 May 2022 12:10:21 -0500 Subject: [PATCH] fix: callback methods --- .../javascripts/Components/NotesList/index.tsx | 4 ++-- .../javascripts/Components/NotesView/index.tsx | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/assets/javascripts/Components/NotesList/index.tsx b/app/assets/javascripts/Components/NotesList/index.tsx index e2bd10784..b22f4d51d 100644 --- a/app/assets/javascripts/Components/NotesList/index.tsx +++ b/app/assets/javascripts/Components/NotesList/index.tsx @@ -20,8 +20,8 @@ type Props = { export const NotesList: FunctionComponent = observer( ({ application, appState, notes, selectedNotes, displayOptions, paginate }) => { - const selectNextNote = useCallback(() => appState.notesView.selectNextNote, [appState]) - const selectPreviousNote = useCallback(() => appState.notesView.selectPreviousNote, [appState]) + const selectNextNote = useCallback(() => appState.notesView.selectNextNote(), [appState]) + const selectPreviousNote = useCallback(() => appState.notesView.selectPreviousNote(), [appState]) const { hideTags, hideDate, hideNotePreview, hideEditorIcon, sortBy } = displayOptions diff --git a/app/assets/javascripts/Components/NotesView/index.tsx b/app/assets/javascripts/Components/NotesView/index.tsx index df464e44f..bc19061cf 100644 --- a/app/assets/javascripts/Components/NotesView/index.tsx +++ b/app/assets/javascripts/Components/NotesView/index.tsx @@ -41,12 +41,12 @@ export const NotesView: FunctionComponent = observer(({ application, appS panelWidth, } = appState.notesView - const createNewNote = useCallback(() => appState.notesView.createNewNote, [appState]) - const onFilterEnter = useCallback(() => appState.notesView.onFilterEnter, [appState]) - const clearFilterText = useCallback(() => appState.notesView.clearFilterText, [appState]) + const createNewNote = useCallback(() => appState.notesView.createNewNote(), [appState]) + const onFilterEnter = useCallback(() => appState.notesView.onFilterEnter(), [appState]) + const clearFilterText = useCallback(() => appState.notesView.clearFilterText(), [appState]) const setNoteFilterText = useCallback((text: string) => appState.notesView.setNoteFilterText(text), [appState]) - const selectNextNote = useCallback(() => appState.notesView.selectNextNote, [appState]) - const selectPreviousNote = useCallback(() => appState.notesView.selectPreviousNote, [appState]) + const selectNextNote = useCallback(() => appState.notesView.selectNextNote(), [appState]) + const selectPreviousNote = useCallback(() => appState.notesView.selectPreviousNote(), [appState]) const [showDisplayOptionsMenu, setShowDisplayOptionsMenu] = useState(false) const [focusedSearch, setFocusedSearch] = useState(false) @@ -64,7 +64,7 @@ export const NotesView: FunctionComponent = observer(({ application, appS modifiers: [KeyboardModifier.Meta, KeyboardModifier.Ctrl], onKeyDown: (event) => { event.preventDefault() - createNewNote() + void createNewNote() }, })