mirror of
https://github.com/zadam/trilium.git
synced 2025-10-20 15:19:01 +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 { 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 (
|
||||
<div className="attribute-list">
|
||||
{ note && (
|
||||
<AttributeEditor note={note} {...restProps} hidden={hidden} />
|
||||
<AttributeEditor ntxId={ntxId} note={note} {...restProps} hidden={hidden} />
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user