feat(PageController): make showMask and hideMask async

This commit is contained in:
Simon
2026-01-19 12:54:33 +08:00
parent ef2777b521
commit 6820eec676
2 changed files with 9 additions and 5 deletions

View File

@@ -198,7 +198,7 @@ export class PageAgent extends EventTarget {
await onBeforeTask.call(this)
// Show mask
this.pageController.showMask()
await this.pageController.showMask()
if (this.#abortController) {
this.#abortController.abort()
@@ -556,7 +556,7 @@ export class PageAgent extends EventTarget {
#onDone(text: string, success = true) {
this.pageController.cleanUpHighlights()
this.pageController.hideMask()
this.pageController.hideMask() // No await - fire and forget
this.#setStatus(success ? 'completed' : 'error')
this.#abortController.abort()
}