mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Fix BatchRequest.execute() multiple window issue (#10423)
This commit is contained in:
parent
73f5d386fe
commit
38078d7a8d
@ -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…
Reference in New Issue
Block a user