From 1c7dfa6c91a371c875c794a84164c7f7dadd732f Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Wed, 27 Aug 2025 13:15:38 +0300 Subject: [PATCH] chore(react/ribbon): fix activation of add new label to all tabs --- apps/client/src/widgets/ribbon/OwnedAttributesTab.tsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/apps/client/src/widgets/ribbon/OwnedAttributesTab.tsx b/apps/client/src/widgets/ribbon/OwnedAttributesTab.tsx index 9169b3c2f..532e7ee29 100644 --- a/apps/client/src/widgets/ribbon/OwnedAttributesTab.tsx +++ b/apps/client/src/widgets/ribbon/OwnedAttributesTab.tsx @@ -2,13 +2,17 @@ import { useTriliumEvents } from "../react/hooks"; import AttributeEditor from "./components/AttributeEditor"; import { TabContext } from "./ribbon-interface"; -export default function OwnedAttributesTab({ note, hidden, activate, ...restProps }: TabContext) { - useTriliumEvents([ "addNewLabel", "addNewRelation" ], activate); +export default function OwnedAttributesTab({ note, hidden, activate, ntxId, ...restProps }: TabContext) { + useTriliumEvents([ "addNewLabel", "addNewRelation" ], ({ ntxId: eventNtxId }) => { + if (ntxId === eventNtxId) { + activate(); + } + }); return (
{ note && ( -
)