mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-18 01:36:08 +08:00
core&ui: add progress callback (beta)
This commit is contained in:
7 files changed
+40
-5
No files matched your search
@@ -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();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user