mirror of
https://github.com/zadam/trilium.git
synced 2025-10-21 07:38:53 +02:00
chore(react/ribbon): fix activation of add new label to all tabs
This commit is contained in:
parent
3a3fed4314
commit
1c7dfa6c91
@ -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>
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user