[Editor] Only add a popup to an existing annotation if it exits

It fixes the ink integration test "must update an existing annotation".
This commit is contained in:
Calixte Denizet 2025-07-18 16:51:24 +02:00
parent 23bd705cea
commit 6d7e0e7025

View File

@ -215,7 +215,7 @@ class AnnotationElement {
}
let popup = this.#popupElement?.popup || this.popup;
if (!popup && newPopup.text) {
if (!popup && newPopup?.text) {
this._createPopup(newPopup);
popup = this.#popupElement.popup;
}
@ -223,7 +223,7 @@ class AnnotationElement {
return;
}
popup.updateEdited(params);
if (newPopup.deleted) {
if (newPopup?.deleted) {
popup.remove();
this.#popupElement = null;
this.popup = null;