From 241876be8361c96f04f0910552443a28045a6e1e Mon Sep 17 00:00:00 2001 From: Wolfsblvt Date: Sun, 30 Jun 2024 19:42:17 +0200 Subject: [PATCH] Fix extension update opening popup twice --- public/scripts/extensions.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/public/scripts/extensions.js b/public/scripts/extensions.js index 3ecf7c893..9fb231264 100644 --- a/public/scripts/extensions.js +++ b/public/scripts/extensions.js @@ -644,6 +644,13 @@ async function showExtensionsDetails() { 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(`
${html}
`, POPUP_TYPE.TEXT, '', { okButton: 'Close', wide: true, large: true, customButtons: [updateAllButton], allowVerticalScrolling: true }); popupPromise = popup.show(); } catch (error) {