diff --git a/packages/hydrooj/src/model/contest.ts b/packages/hydrooj/src/model/contest.ts index e4eaec48..122a04f9 100644 --- a/packages/hydrooj/src/model/contest.ts +++ b/packages/hydrooj/src/model/contest.ts @@ -73,7 +73,7 @@ export function isExtended(tdoc: Tdoc) { function buildContestRule(def: Optional, 'applyProjection'>): ContestRule; function buildContestRule(def: Partial>, baseRule: ContestRule): ContestRule; function buildContestRule(def: Partial>, baseRule: ContestRule = {} as any) { - const base = baseRule._originalRule || {}; + const base = baseRule._originalRule || { applyProjection: (_, rdoc) => rdoc }; const funcs = ['scoreboard', 'scoreboardRow', 'scoreboardHeader', 'stat', 'applyProjection']; const f = {}; const rule = { ...baseRule, ...def }; @@ -82,7 +82,6 @@ function buildContestRule(def: Partial>, baseRule: ContestRule rule[key] = f[key].bind(rule); } rule._originalRule = f; - rule.applyProjection ||= (_, rdoc) => rdoc; return rule; }