Fixed CompendiumBrowser Class filter for Subclass view

This commit is contained in:
WBHarry 2026-05-03 12:14:04 +02:00
parent 2c6d813f25
commit e28d90fe71
2 changed files with 17 additions and 13 deletions

View file

@ -393,15 +393,18 @@ export const typeConfig = {
],
filters: [
{
key: 'system.linkedClass.uuid',
key: 'system.linkedClass',
label: 'TYPES.Item.class',
choices: items => {
const list = items
.filter(item => item.system.linkedClass)
.map(item => ({
value: item.system.linkedClass.uuid,
label: item.system.linkedClass.name
}));
choices: async items => {
const list = [];
for(const item of items.filter(item => item.system.linkedClass)) {
const linkedClass = await foundry.utils.fromUuid(item.system.linkedClass);
list.push({
value: linkedClass.uuid,
label: linkedClass.name
});
}
return list.reduce((a, c) => {
if (!a.find(i => i.value === c.value)) a.push(c);
return a;