diff --git a/app/scripts/background.js b/app/scripts/background.js index ca7c04951..c9155c858 100644 --- a/app/scripts/background.js +++ b/app/scripts/background.js @@ -53,6 +53,7 @@ global.METAMASK_NOTIFIER = notificationManager; let popupIsOpen = false; let notificationIsOpen = false; +let uiIsTriggering = false; const openMetamaskTabsIDs = {}; const requestAccountTabIds = {}; @@ -482,8 +483,17 @@ async function triggerUi() { tabs.length > 0 && tabs[0].extData && tabs[0].extData.indexOf('vivaldi_tab') > -1; - if ((isVivaldi || !popupIsOpen) && !currentlyActiveMetamaskTab) { - await notificationManager.showPopup(); + if ( + !uiIsTriggering && + (isVivaldi || !popupIsOpen) && + !currentlyActiveMetamaskTab + ) { + uiIsTriggering = true; + try { + await notificationManager.showPopup(); + } finally { + uiIsTriggering = false; + } } }