Merge pull request #19557 from Snuffleupagus/PDFViewer-cleanupTimeouts
Abort various timeouts, in `PDFViewer`, when closing the document (PR 19128 follow-up)
This commit is contained in:
commit
4a48a7ec0f
@ -1173,6 +1173,7 @@ class PDFViewer {
|
|||||||
this.#hiddenCopyElement?.remove();
|
this.#hiddenCopyElement?.remove();
|
||||||
this.#hiddenCopyElement = null;
|
this.#hiddenCopyElement = null;
|
||||||
|
|
||||||
|
this.#cleanupTimeouts();
|
||||||
this.#cleanupSwitchAnnotationEditorMode();
|
this.#cleanupSwitchAnnotationEditorMode();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2340,6 +2341,17 @@ class PDFViewer {
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#cleanupTimeouts() {
|
||||||
|
if (this.#scaleTimeoutId !== null) {
|
||||||
|
clearTimeout(this.#scaleTimeoutId);
|
||||||
|
this.#scaleTimeoutId = null;
|
||||||
|
}
|
||||||
|
if (this.#scrollTimeoutId !== null) {
|
||||||
|
clearTimeout(this.#scrollTimeoutId);
|
||||||
|
this.#scrollTimeoutId = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#cleanupSwitchAnnotationEditorMode() {
|
#cleanupSwitchAnnotationEditorMode() {
|
||||||
this.#switchAnnotationEditorModeAC?.abort();
|
this.#switchAnnotationEditorModeAC?.abort();
|
||||||
this.#switchAnnotationEditorModeAC = null;
|
this.#switchAnnotationEditorModeAC = null;
|
||||||
@ -2466,14 +2478,8 @@ class PDFViewer {
|
|||||||
for (const pageView of this._pages) {
|
for (const pageView of this._pages) {
|
||||||
pageView.update(updateArgs);
|
pageView.update(updateArgs);
|
||||||
}
|
}
|
||||||
if (this.#scaleTimeoutId !== null) {
|
this.#cleanupTimeouts();
|
||||||
clearTimeout(this.#scaleTimeoutId);
|
|
||||||
this.#scaleTimeoutId = null;
|
|
||||||
}
|
|
||||||
if (this.#scrollTimeoutId !== null) {
|
|
||||||
clearTimeout(this.#scrollTimeoutId);
|
|
||||||
this.#scrollTimeoutId = null;
|
|
||||||
}
|
|
||||||
if (!noUpdate) {
|
if (!noUpdate) {
|
||||||
this.update();
|
this.update();
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user