Fix BatchRequest.execute() multiple window issue (#10423)

feature/default_network_editable
jpatel888 4 years ago committed by GitHub
parent 73f5d386fe
commit 38078d7a8d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 14
      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;
}
}
}

Loading…
Cancel
Save