Fixed tooltip enrichment

This commit is contained in:
WBHarry 2025-07-25 23:58:53 +02:00
parent a5b656f533
commit 6f9a249868
11 changed files with 70 additions and 25 deletions

View file

@ -252,9 +252,18 @@ export function addLinkedItemsDiff(changedItems, currentItems, options) {
if (changedItems) {
const prevItems = new Set(currentItems);
const newItems = new Set(changedItems);
options.toLink = Array.from(newItems.difference(prevItems).map(item => item?.item ?? item));
options.toLink = Array.from(
newItems
.difference(prevItems)
.map(item => item?.item ?? item)
.filter(x => (typeof x === 'object' ? x.item : x))
);
options.toUnlink = Array.from(
prevItems.difference(newItems).map(item => item?.item?.uuid ?? item?.uuid ?? item)
prevItems
.difference(newItems)
.map(item => item?.item?.uuid ?? item?.uuid ?? item)
.filter(x => (typeof x === 'object' ? x.item : x))
);
}
}