chore(react/ribbon): fix activation of add new label to all tabs

This commit is contained in:
Elian Doran 2025-08-27 13:15:38 +03:00
parent 3a3fed4314
commit 1c7dfa6c91
No known key found for this signature in database

View File

@ -2,13 +2,17 @@ import { useTriliumEvents } from "../react/hooks";
import AttributeEditor from "./components/AttributeEditor"; import AttributeEditor from "./components/AttributeEditor";
import { TabContext } from "./ribbon-interface"; import { TabContext } from "./ribbon-interface";
export default function OwnedAttributesTab({ note, hidden, activate, ...restProps }: TabContext) { export default function OwnedAttributesTab({ note, hidden, activate, ntxId, ...restProps }: TabContext) {
useTriliumEvents([ "addNewLabel", "addNewRelation" ], activate); useTriliumEvents([ "addNewLabel", "addNewRelation" ], ({ ntxId: eventNtxId }) => {
if (ntxId === eventNtxId) {
activate();
}
});
return ( return (
<div className="attribute-list"> <div className="attribute-list">
{ note && ( { note && (
<AttributeEditor note={note} {...restProps} hidden={hidden} /> <AttributeEditor ntxId={ntxId} note={note} {...restProps} hidden={hidden} />
)} )}
</div> </div>
) )