mirror of
https://github.com/zadam/trilium.git
synced 2025-12-06 15:34:26 +01:00
fix(launch_bar): note context not properly set for legacy widgets
This commit is contained in:
parent
3bf6de9c76
commit
17241be4bc
@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user