Fixed bug in last release where unlimited slots were always hidden on hide when full

This commit is contained in:
Stefan Zermatten
2021-01-12 13:51:11 +02:00
parent 85f3881935
commit d63b8c835d

View File

@@ -131,16 +131,25 @@ export default {
],
}
}).map(slot => {
slot.children = CreatureProperties.find({
'parent.id': slot._id,
removed: {$ne: true},
}, {
sort: { order: 1 },
}).fetch();
if (
!this.showHiddenSlots &&
slot.quantityExpected === 0 &&
slot.hideWhenFull
){
slot.children = []
} else {
slot.children = CreatureProperties.find({
'parent.id': slot._id,
removed: {$ne: true},
}, {
sort: { order: 1 },
}).fetch();
}
return slot;
}).filter(slot => !( // Hide full and ignored slots
!this.showHiddenSlots &&
slot.hideWhenFull &&
slot.quantityExpected > 0 &&
slot.totalFilled >= slot.quantityExpected ||
slot.ignored
));