Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions plugins/card-resources/src/exporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,14 @@ async function exportType (_id: Ref<Class<Doc>>, processed: Set<Ref<Doc>>): Prom
const m = client.getModel()
const h = client.getHierarchy()
const type = m.findObject(_id)

const parent = h.getClass(_id).extends
if (parent !== undefined && h.isDerived(parent, card.class.Card) && parent !== card.class.Card) {
if (!processed.has(parent)) {
res.push(...(await exportType(parent, processed)))
}
}

processed.add(_id)
if (type === undefined) return res
if (type.icon === view.ids.IconWithEmoji && typeof type.color === 'string') {
Expand Down Expand Up @@ -175,13 +183,6 @@ async function exportType (_id: Ref<Class<Doc>>, processed: Set<Ref<Doc>>): Prom
required.push(...extRes.required)
}

const parent = h.getClass(_id).extends
if (parent !== undefined && h.isDerived(parent, card.class.Card) && parent !== card.class.Card) {
if (!processed.has(parent)) {
required.push(parent)
}
}

for (const req of required) {
res.push(...(await exportType(req, processed)))
}
Expand Down
Loading