core&ui: add progress callback (beta)

This commit is contained in:
undefined committed 2023-04-09 23:55:29 +08:00
1 parent 275e82f0e5
commit 16db95ee87
7 files changed
+40 -5

No files matched your search

+3
View File
@@ -251,6 +251,7 @@ export class ProblemMainHandler extends Handler {
@param('pids', Types.NumericArray)
async postDelete(domainId: string, pids: number[]) {
let i = 0;
for (const pid of pids) {
// eslint-disable-next-line no-await-in-loop
const pdoc = await problem.get(domainId, pid);
@@ -258,6 +259,8 @@ export class ProblemMainHandler extends Handler {
if (!this.user.own(pdoc, PERM.PERM_EDIT_PROBLEM_SELF)) this.checkPerm(PERM.PERM_EDIT_PROBLEM);
// eslint-disable-next-line no-await-in-loop
await problem.del(domainId, pid);
i++;
this.progress(`Deleting: (${i}/${pids.length})`);
}
this.back();
}