Remove unused template context.

This commit is contained in:
George Brocklehurst 2025-07-20 10:20:38 +01:00
parent 25bd00812d
commit 26d412815a
No known key found for this signature in database
GPG key ID: 0C643A97B51FFCFB

View file

@ -24,7 +24,6 @@ export default class DhpDowntime extends HandlebarsApplicationMixin(ApplicationV
actor.system.bonuses.rest[`${shortrest ? 'short' : 'long'}Rest`].longMoves actor.system.bonuses.rest[`${shortrest ? 'short' : 'long'}Rest`].longMoves
} }
}; };
this.nrChoices.total = { max: this.nrChoices.shortRest.max + this.nrChoices.longRest.max };
} }
get title() { get title() {
@ -64,10 +63,6 @@ export default class DhpDowntime extends HandlebarsApplicationMixin(ApplicationV
); );
context.selectedActivity = this.selectedActivity; context.selectedActivity = this.selectedActivity;
context.moveData = this.moveData; context.moveData = this.moveData;
context.nrCurrentChoices = Object.values(this.moveData).reduce((acc, category) => {
acc += Object.values(category.moves).reduce((acc, x) => acc + (x.selected ?? 0), 0);
return acc;
}, 0);
const shortRestMovesSelected = Object.values(this.moveData.shortRest.moves).reduce( const shortRestMovesSelected = Object.values(this.moveData.shortRest.moves).reduce(
(acc, x) => acc + (x.selected ?? 0), (acc, x) => acc + (x.selected ?? 0),
@ -88,10 +83,6 @@ export default class DhpDowntime extends HandlebarsApplicationMixin(ApplicationV
current: this.nrChoices.longRest.taken + longRestMovesSelected current: this.nrChoices.longRest.taken + longRestMovesSelected
} }
}; };
context.nrChoices.total = {
...this.nrChoices.total,
current: context.nrChoices.shortRest.current + context.nrChoices.longRest.current
};
context.shortRestMoves = this.nrChoices.shortRest.max > 0 ? this.moveData.shortRest : null; context.shortRestMoves = this.nrChoices.shortRest.max > 0 ? this.moveData.shortRest : null;
context.longRestMoves = this.nrChoices.longRest.max > 0 ? this.moveData.longRest : null; context.longRestMoves = this.nrChoices.longRest.max > 0 ? this.moveData.longRest : null;