Skip to content

Commit

Permalink
fix: callback methods
Browse files Browse the repository at this point in the history
  • Loading branch information
moughxyz committed May 17, 2022
1 parent 27f864a commit 18e68ad
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions app/assets/javascripts/Components/NotesList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ type Props = {

export const NotesList: FunctionComponent<Props> = 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

Expand Down
12 changes: 6 additions & 6 deletions app/assets/javascripts/Components/NotesView/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ export const NotesView: FunctionComponent<Props> = 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)
Expand All @@ -64,7 +64,7 @@ export const NotesView: FunctionComponent<Props> = observer(({ application, appS
modifiers: [KeyboardModifier.Meta, KeyboardModifier.Ctrl],
onKeyDown: (event) => {
event.preventDefault()
createNewNote()
void createNewNote()
},
})

Expand Down

0 comments on commit 18e68ad

Please sign in to comment.