Fix extension update opening popup twice

This commit is contained in:
Wolfsblvt 2024-06-30 19:42:17 +02:00
parent 8ce2af16fb
commit 241876be83
1 changed files with 7 additions and 0 deletions

View File

@ -644,6 +644,13 @@ async function showExtensionsDetails() {
popup.complete(POPUP_RESULT.AFFIRMATIVE); popup.complete(POPUP_RESULT.AFFIRMATIVE);
}, },
}; };
// If we are updating an extension, the "old" popup is still active. We should close that.
const oldPopup = Popup.util.popups.find(popup => popup.content.querySelector('.extensions_info'));
if (oldPopup) {
oldPopup.complete(POPUP_RESULT.CANCELLED);
}
const popup = new Popup(`<div class="extensions_info">${html}</div>`, POPUP_TYPE.TEXT, '', { okButton: 'Close', wide: true, large: true, customButtons: [updateAllButton], allowVerticalScrolling: true }); const popup = new Popup(`<div class="extensions_info">${html}</div>`, POPUP_TYPE.TEXT, '', { okButton: 'Close', wide: true, large: true, customButtons: [updateAllButton], allowVerticalScrolling: true });
popupPromise = popup.show(); popupPromise = popup.show();
} catch (error) { } catch (error) {