From 323f6b72f13465480607eb1de4fc1a200f2e2821 Mon Sep 17 00:00:00 2001 From: undefined Date: Thu, 30 Nov 2023 20:31:53 +0800 Subject: [PATCH] core: record: fix projection --- packages/hydrooj/src/handler/record.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/hydrooj/src/handler/record.ts b/packages/hydrooj/src/handler/record.ts index aeed54370..1bb612bcc 100644 --- a/packages/hydrooj/src/handler/record.ts +++ b/packages/hydrooj/src/handler/record.ts @@ -331,9 +331,9 @@ class RecordMainConnectionHandler extends ConnectionHandler { if (!problem.canViewBy(pdoc, this.user)) pdoc = null; if (!this.user.hasPerm(PERM.PERM_VIEW_PROBLEM)) pdoc = null; } + if (this.applyProjection && typeof rdoc.input !== 'string') rdoc = contest.applyProjection(tdoc, rdoc, this.user); if (this.pretest) this.send({ rdoc: omit(rdoc, ['code', 'input']) }); else { - if (this.applyProjection) rdoc = contest.applyProjection(tdoc, rdoc, this.user); this.send({ html: await this.renderHTML('record_main_tr.html', { rdoc, udoc, pdoc, tdoc, allDomain: this.allDomain,