diff --git a/apps/client/src/widgets/basic_widget.ts b/apps/client/src/widgets/basic_widget.ts index 22d1864fb..3eb2e86f5 100644 --- a/apps/client/src/widgets/basic_widget.ts +++ b/apps/client/src/widgets/basic_widget.ts @@ -293,7 +293,6 @@ export class ReactWrappedWidget extends BasicWidget { handleEvent(name: T, data: EventData): Promise | null | undefined { const listener = this.listeners[name]; - console.log("Handle ", name, listener); listener?.(data); } diff --git a/apps/client/src/widgets/react/hooks.tsx b/apps/client/src/widgets/react/hooks.tsx index 925ac24f1..d43d25f61 100644 --- a/apps/client/src/widgets/react/hooks.tsx +++ b/apps/client/src/widgets/react/hooks.tsx @@ -231,19 +231,19 @@ export function useNoteContext() { const [ noteContext, setNoteContext ] = useState(); const [ notePath, setNotePath ] = useState(); - useTriliumEvent("activeContextChanged", ({ noteContext }) => { - console.log("Active context changed."); + useTriliumEventBeta("activeContextChanged", ({ noteContext }) => { setNoteContext(noteContext); + setNotePath(noteContext.notePath); }); useTriliumEventBeta("setNoteContext", ({ noteContext }) => { console.log("Set note context", noteContext, noteContext.noteId); setNoteContext(noteContext); }); - useTriliumEvent("noteSwitchedAndActivated", ({ noteContext }) => { + useTriliumEventBeta("noteSwitchedAndActivated", ({ noteContext }) => { console.log("Note switched and activated") setNoteContext(noteContext); }); - useTriliumEvent("noteSwitched", ({ noteContext, notePath }) => { + useTriliumEventBeta("noteSwitched", ({ noteContext, notePath }) => { console.warn("Note switched", notePath); setNotePath(notePath); });