Fixed so that hidden countdowns don't take up space

This commit is contained in:
WBHarry 2026-06-12 15:37:50 +02:00
parent 8e5cdedaac
commit f91bfaecb1
3 changed files with 14 additions and 2 deletions

View file

@ -186,6 +186,7 @@ export default class DhCountdowns extends HandlebarsApplicationMixin(Application
context.userCountdownTypes = game.user.getFlag(CONFIG.DH.id, CONFIG.DH.FLAGS.userFlags.countdownTypeModes)
?? [shortterm.id, longterm.id];
context.typeToggles =
Object.values(CONFIG.DH.GENERAL.countdownType).map(type => ({
type: type.id,
@ -194,6 +195,13 @@ export default class DhCountdowns extends HandlebarsApplicationMixin(Application
}));
context.countdowns = this._getCountdownData();
context.countdownTypesWithVisibleEntries = this.#getCountdowns().reduce((acc, data) => {
if (context.userCountdownTypes.includes(data.countdown.type) && !acc.includes(data.countdown.type))
acc.push(data.countdown.type);
return acc;
}, []);
return context;
}