mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: fix pretest
This commit is contained in:
1 parent
bd9840cc45
commit
07acf91838
4 files changed
+6
-6
No files matched your search
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "hydrooj",
|
||||
"version": "2.29.29",
|
||||
"version": "2.29.30",
|
||||
"bin": "bin/hydrooj.js",
|
||||
"main": "dist/loader.js",
|
||||
"typings": "dist/loader.d.ts",
|
||||
|
||||
@@ -226,7 +226,7 @@ class RecordMainConnectionHandler extends ConnectionHandler {
|
||||
async onRecordChange(rdoc: RecordDoc) {
|
||||
if (rdoc.domainId !== this.domainId) return;
|
||||
if (!this.pretest && rdoc.input) return;
|
||||
if (!this.pretest && rdoc.contest && rdoc.contest.tid.toString() !== this.tid) return;
|
||||
if (!rdoc.input && rdoc.contest && rdoc.contest.tid.toString() !== this.tid) return;
|
||||
if (this.uid && rdoc.uid !== this.uid) return;
|
||||
if (this.pid && (rdoc.pid !== this.pid || rdoc.pdomain !== this.pdomain)) return;
|
||||
// eslint-disable-next-line prefer-const
|
||||
@@ -239,7 +239,7 @@ class RecordMainConnectionHandler extends ConnectionHandler {
|
||||
if (pdoc.hidden && !this.user.own(pdoc) && !this.user.hasPerm(PERM.PERM_VIEW_PROBLEM_HIDDEN)) pdoc = null;
|
||||
if (!this.user.hasPerm(PERM.PERM_VIEW_PROBLEM)) pdoc = null;
|
||||
}
|
||||
if (this.pretest) this.send({ rdoc });
|
||||
if (rdoc.input) this.send({ rdoc });
|
||||
else {
|
||||
this.send({
|
||||
html: await this.renderHTML('record_main_tr.html', {
|
||||
|
||||
Reference in new issue
Block a user