Fixed migration issue with slot.slotType = slotFiller

This commit is contained in:
Stefan Zermatten
2023-06-21 14:31:15 +02:00
parent 7457372e13
commit 4f4779c3e5
3 changed files with 24 additions and 4 deletions

View File

@@ -2,8 +2,13 @@ export default function getDefaultSlotFiller(slot) {
if (typeof slot !== 'object') throw 'getDefaultSlotFiller requires a slot';
if (slot.type !== 'propertySlot') throw 'provided slot must be a propertySlot';
let slotType = slot.slotType;
if (!slotType || slot.slotType === 'slotFiller') {
slotType = 'folder';
}
const filler = {
type: slot.slotType || 'folder',
type: slotType,
libraryTags: slot.slotTags || [],
name: 'Custom ' + slot.name || 'slot filler',
parent: { collection: 'creatureProperties', id: slot._id },