use document selector to check whether any dialog is opened

This commit is contained in:
schlagmichdoch 2023-01-07 03:04:48 +01:00
parent 10276b472d
commit 9900aaf167

View file

@ -68,17 +68,7 @@ class PeersUI {
}
_onPaste(e) {
const dialogNodes = document.querySelectorAll('x-dialog');
let dialogIsOpen = false
dialogNodes.forEach(function (dialogNode) {
for(let i=0; i<dialogNode.attributes.length; i++){
if (dialogNode.attributes[i].name === "show") {
dialogIsOpen = true;
break
}
}
});
if(!dialogIsOpen) {
if(document.querySelectorAll('x-dialog[show]').length === 0) {
// prevent send on paste when dialog is open
e.preventDefault()
const files = e.clipboardData.files;