diff --git a/apps/client/src/widgets/react/hooks.tsx b/apps/client/src/widgets/react/hooks.tsx index 1110f4e1b..0b0cea3a0 100644 --- a/apps/client/src/widgets/react/hooks.tsx +++ b/apps/client/src/widgets/react/hooks.tsx @@ -202,17 +202,10 @@ export function useNoteContext() { setNote(noteContext?.note); }, [ notePath ]); - useTriliumEvent("activeContextChanged", ({ noteContext }) => { + useTriliumEvents([ "setNoteContext", "activeContextChanged", "noteSwitchedAndActivated", "noteSwitched" ], ({ noteContext }) => { setNoteContext(noteContext); setNotePath(noteContext.notePath); }); - useTriliumEvent("noteSwitchedAndActivated", ({ noteContext }) => { - setNoteContext(noteContext); - }); - useTriliumEvent("noteSwitched", ({ notePath, noteContext }) => { - setNoteContext(noteContext); - setNotePath(notePath); - }); useTriliumEvent("frocaReloaded", () => { setNote(noteContext?.note); });