Skip to content

Build your personal knowledge base with Trilium Notes

fix(launch_bar): note context not properly set for legacy widgets

Elian Doran17241be4bc75
diff --git a/apps/client/src/widgets/launch_bar/LauncherDefinitions.tsx b/apps/client/src/widgets/launch_bar/LauncherDefinitions.tsx
index 2d399ff8ca..a47326ebea 100644
--- a/apps/client/src/widgets/launch_bar/LauncherDefinitions.tsx
+++ b/apps/client/src/widgets/launch_bar/LauncherDefinitions.tsx
@@ -10,7 +10,7 @@ import { CustomNoteLauncher } from "./GenericButtons";
import { LaunchBarActionButton, LaunchBarContext, LauncherNoteProps, useLauncherIconAndTitle } from "./launch_bar_widgets";
import dialog from "../../services/dialog";
import { t } from "../../services/i18n";
-import { CommandNames } from "../../components/app_context";
+import appContext, { CommandNames } from "../../components/app_context";
export function CommandButton({ launcherNote }: LauncherNoteProps) {
const { icon, title } = useLauncherIconAndTitle(launcherNote);
@@ -132,9 +132,9 @@ export function CustomWidget({ launcherNote }: LauncherNoteProps) {
}
export function LegacyWidgetRenderer({ widget }: { widget: BasicWidget }) {
- const { noteContext } = useNoteContext();
const [ widgetEl ] = useLegacyWidget(() => widget, {
- noteContext
+ noteContext: appContext.tabManager.getActiveContext() ?? undefined
});
+
return widgetEl;
}