Skip to content

Commit eec1bea

Browse files
committed
[Editor] Don't use a null signal for the comment button
This removes the following error from the integration test logs: ``` JavaScript error: http://127.0.0.1:59283/build/generic/build/pdf.mjs, line 3879: TypeError: EventTarget.addEventListener: 'signal' member of AddEventListenerOptions is not an object. ``` Fixes 636ff50. Extends 6365188.
1 parent 535a042 commit eec1bea

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/display/editor/comment.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,17 @@ class Comment {
3939
if (!this.#editor._uiManager.hasCommentManager()) {
4040
return null;
4141
}
42+
4243
const comment = (this.#commentButton = document.createElement("button"));
4344
comment.className = "comment";
4445
comment.tabIndex = "0";
4546
comment.setAttribute("data-l10n-id", "pdfjs-editor-edit-comment-button");
4647

4748
const signal = this.#editor._uiManager._signal;
49+
if (!(signal instanceof AbortSignal) || signal.aborted) {
50+
return comment;
51+
}
52+
4853
comment.addEventListener("contextmenu", noContextMenu, { signal });
4954
comment.addEventListener("pointerdown", event => event.stopPropagation(), {
5055
signal,

0 commit comments

Comments
 (0)