From 2359062b62cf65f38b36ccb6bb33fa7d15ada1ae Mon Sep 17 00:00:00 2001 From: Dan Miller Date: Mon, 23 Jul 2018 22:20:06 -0230 Subject: UI confirm screen closes confirmation window on submit or cancel of a tx --- app/scripts/platforms/extension.js | 6 ++++++ app/scripts/ui.js | 8 ++++---- 2 files changed, 10 insertions(+), 4 deletions(-) (limited to 'app') diff --git a/app/scripts/platforms/extension.js b/app/scripts/platforms/extension.js index 901c26cab..bd4f7bd9f 100644 --- a/app/scripts/platforms/extension.js +++ b/app/scripts/platforms/extension.js @@ -14,6 +14,12 @@ class ExtensionPlatform { extension.tabs.create({ url }) } + closeCurrentWindow (cb) { + return extension.windows.getCurrent((windowDetails) => { + return extension.windows.remove(windowDetails.id) + }) + } + getVersion () { return extension.runtime.getManifest().version } diff --git a/app/scripts/ui.js b/app/scripts/ui.js index 9bf97be87..42703f029 100644 --- a/app/scripts/ui.js +++ b/app/scripts/ui.js @@ -64,16 +64,16 @@ async function start () { css = betaUIState ? NewMetaMaskUiCss() : OldMetaMaskUiCss() deleteInjectedCss = injectCss(css) } - if (state.appState.shouldClose) notificationManager.closePopup() + // if (state.appState.shouldClose) notificationManager.closePopup() }) }) function closePopupIfOpen (windowType) { - if (windowType !== ENVIRONMENT_TYPE_NOTIFICATION) { + // if (windowType !== ENVIRONMENT_TYPE_NOTIFICATION) { // should close only chrome popup - notificationManager.closePopup() - } + // notificationManager.closePopup() + // } } function displayCriticalError (err) { -- cgit v1.2.3 From 64a82fd3dae66f33b0934d58e43e85df27fbfe1d Mon Sep 17 00:00:00 2001 From: Dan Miller Date: Tue, 24 Jul 2018 11:45:36 -0230 Subject: Uncomment closePopupIfOpen code. --- app/scripts/ui.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'app') diff --git a/app/scripts/ui.js b/app/scripts/ui.js index 42703f029..cbe15c92d 100644 --- a/app/scripts/ui.js +++ b/app/scripts/ui.js @@ -70,10 +70,10 @@ async function start () { function closePopupIfOpen (windowType) { - // if (windowType !== ENVIRONMENT_TYPE_NOTIFICATION) { + if (windowType !== ENVIRONMENT_TYPE_NOTIFICATION) { // should close only chrome popup - // notificationManager.closePopup() - // } + notificationManager.closePopup() + } } function displayCriticalError (err) { -- cgit v1.2.3 From a61227f224e37559c8d6e2c59441b0032633feaf Mon Sep 17 00:00:00 2001 From: Dan Miller Date: Tue, 24 Jul 2018 15:01:03 -0230 Subject: Remove unneeded code from i4829-close-notifications-from-ui branch. --- app/scripts/platforms/extension.js | 2 +- app/scripts/ui.js | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) (limited to 'app') diff --git a/app/scripts/platforms/extension.js b/app/scripts/platforms/extension.js index bd4f7bd9f..0803164e8 100644 --- a/app/scripts/platforms/extension.js +++ b/app/scripts/platforms/extension.js @@ -14,7 +14,7 @@ class ExtensionPlatform { extension.tabs.create({ url }) } - closeCurrentWindow (cb) { + closeCurrentWindow () { return extension.windows.getCurrent((windowDetails) => { return extension.windows.remove(windowDetails.id) }) diff --git a/app/scripts/ui.js b/app/scripts/ui.js index cbe15c92d..da100f928 100644 --- a/app/scripts/ui.js +++ b/app/scripts/ui.js @@ -64,7 +64,6 @@ async function start () { css = betaUIState ? NewMetaMaskUiCss() : OldMetaMaskUiCss() deleteInjectedCss = injectCss(css) } - // if (state.appState.shouldClose) notificationManager.closePopup() }) }) -- cgit v1.2.3