Fixed build tree

This commit is contained in:
Thaum Rystra
2024-03-26 09:54:11 +02:00
parent d2a553abda
commit 0eb763dc0e
2 changed files with 3 additions and 7 deletions

View File

@@ -55,7 +55,7 @@
/>
<v-spacer />
<v-btn
v-if="doc.parent.id === parentSlotId"
v-if="doc.parentId === parentSlotId"
icon
:disabled="context.editPermission === false"
@click.stop="remove(doc)"

View File

@@ -346,20 +346,16 @@ export default {
],
removed: {$ne: true},
inactive: {$ne: true},
}, {
sort: {order: 1}
});
const slotIds = slots.map(s => s._id);
const slotChildren = CreatureProperties.find({
'parent.id': {$in: slotIds},
'parentId': {$in: slotIds},
removed: {$ne: true},
}, {
sort: { order: 1 },
});
const tree = docsToForest([
...slots.fetch(),
...slotChildren.fetch()
]);
].sort((a, b) => a.left - b.left));
traverse(tree, (child, parents) => {
const model = child.doc;
const isSlotWithSpace = model.type === 'propertySlot' && (