Focus the notification popup if it's already open (#8318)

Any action in the background that would have opened the notification
window will now focus the window instead if it was already open.
Previously it would leave the window unfocused. This was particularly
inconvenient when taking multiple actions in quick succession that all
require confirmations (e.g. triggering multiple transactions).
feature/default_network_editable
Mark Stacey 5 years ago committed by GitHub
parent 852277b2ae
commit e02a0221fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      app/scripts/background.js

@ -458,7 +458,7 @@ function setupController (initState, initLangCode) {
async function triggerUi () { async function triggerUi () {
const tabs = await platform.getActiveTabs() const tabs = await platform.getActiveTabs()
const currentlyActiveMetamaskTab = Boolean(tabs.find((tab) => openMetamaskTabsIDs[tab.id])) const currentlyActiveMetamaskTab = Boolean(tabs.find((tab) => openMetamaskTabsIDs[tab.id]))
if (!popupIsOpen && !currentlyActiveMetamaskTab && !notificationIsOpen) { if (!popupIsOpen && !currentlyActiveMetamaskTab) {
await notificationManager.showPopup() await notificationManager.showPopup()
} }
} }

Loading…
Cancel
Save