diff --git a/src/features/achievements/achievement.tsx b/src/features/achievements/achievement.tsx index 2d00c49..7a38331 100644 --- a/src/features/achievements/achievement.tsx +++ b/src/features/achievements/achievement.tsx @@ -182,6 +182,13 @@ export function createAchievement( decorator.preConstruct?.(achievement); } Object.assign(achievement, decoratedData); + for (const decorator of decorators) { + decorator.postConstruct?.(achievement); + } + const decoratedProps = decorators.reduce( + (current, next) => Object.assign(current, next.getGatheredProps?.(achievement)), + {} + ); function complete() { earned.value = true; @@ -209,12 +216,7 @@ export function createAchievement( } } - const decoratedProps = decorators.reduce( - (current, next) => Object.assign(current, next.getGatheredProps?.(achievement)), - {} - ); - - function gatherProps(this: Achievement): Record { + function gatherProps(this: GenericAchievement): Record { const { visibility, display, @@ -242,10 +244,6 @@ export function createAchievement( }; } - for (const decorator of decorators) { - decorator.postConstruct?.(achievement); - } - if (achievement.requirements != null) { const requirements = [ createVisibilityRequirement(achievement),