diff options
ui - move popup auto-close after tx conf to ui entrypoint
Diffstat (limited to 'app')
-rw-r--r-- | app/scripts/popup.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/app/scripts/popup.js b/app/scripts/popup.js index f6dcb829b..ce18dc422 100644 --- a/app/scripts/popup.js +++ b/app/scripts/popup.js @@ -17,13 +17,17 @@ global.METAMASK_UI_TYPE = windowType closePopupIfOpen(windowType) // setup stream to background -const extensionPort = extension.runtime.connect({ windowType }) +const extensionPort = extension.runtime.connect({ name: windowType }) const connectionStream = new PortStream(extensionPort) // start ui const container = document.getElementById('app-content') startPopup({ container, connectionStream }, (err, store) => { if (err) return displayCriticalError(err) + store.subscribe(() => { + const state = store.getState() + if (state.appState.shouldClose) notificationManager.closePopup() + }) }) |