only remove if exists

This commit is contained in:
LenAnderson
2024-06-23 14:27:10 -04:00
parent 13496cfb3a
commit 31a67a973a

View File

@ -620,7 +620,7 @@ export class QuickReply {
this.clone.style.visibility = 'hidden';
const mo = new MutationObserver(muts=>{
if (muts.find(it=>[...it.removedNodes].includes(this.editorMessage) || [...it.removedNodes].find(n=>n.contains(this.editorMessage)))) {
this.clone.remove();
this.clone?.remove();
this.clone = null;
}
});