core: fix contest unlock button is not working (#616)

This commit is contained in:
panda authored and GitHub committed 2023-07-16 00:23:14 +08:00
1 parent a6128a7328
commit 035670e117
1 file changed
+1 -1
+1 -1
View File
@@ -839,8 +839,8 @@ export async function recalcStatus(domainId: string, tid: ObjectId) {
export async function unlockScoreboard(domainId: string, tid: ObjectId) {
const tdoc = await document.get(domainId, document.TYPE_CONTEST, tid);
if (!tdoc.lockAt || tdoc.unlocked) return;
await recalcStatus(domainId, tid);
await edit(domainId, tid, { unlocked: true });
await recalcStatus(domainId, tid);
}
export function canViewHiddenScoreboard(this: { user: User }, tdoc: Tdoc<30>) {