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

This commit is contained in:
Elian Doran 2025-12-05 18:01:46 +02:00
parent 3bf6de9c76
commit 17241be4bc
No known key found for this signature in database

View File

@ -10,7 +10,7 @@ import { CustomNoteLauncher } from "./GenericButtons";
import { LaunchBarActionButton, LaunchBarContext, LauncherNoteProps, useLauncherIconAndTitle } from "./launch_bar_widgets"; import { LaunchBarActionButton, LaunchBarContext, LauncherNoteProps, useLauncherIconAndTitle } from "./launch_bar_widgets";
import dialog from "../../services/dialog"; import dialog from "../../services/dialog";
import { t } from "../../services/i18n"; import { t } from "../../services/i18n";
import { CommandNames } from "../../components/app_context"; import appContext, { CommandNames } from "../../components/app_context";
export function CommandButton({ launcherNote }: LauncherNoteProps) { export function CommandButton({ launcherNote }: LauncherNoteProps) {
const { icon, title } = useLauncherIconAndTitle(launcherNote); const { icon, title } = useLauncherIconAndTitle(launcherNote);
@ -132,9 +132,9 @@ export function CustomWidget({ launcherNote }: LauncherNoteProps) {
} }
export function LegacyWidgetRenderer({ widget }: { widget: BasicWidget }) { export function LegacyWidgetRenderer({ widget }: { widget: BasicWidget }) {
const { noteContext } = useNoteContext();
const [ widgetEl ] = useLegacyWidget(() => widget, { const [ widgetEl ] = useLegacyWidget(() => widget, {
noteContext noteContext: appContext.tabManager.getActiveContext() ?? undefined
}); });
return widgetEl; return widgetEl;
} }