aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Miller <danjm.com@gmail.com>2018-07-24 08:50:06 +0800
committerDan Miller <danjm.com@gmail.com>2018-07-24 08:50:06 +0800
commit2359062b62cf65f38b36ccb6bb33fa7d15ada1ae (patch)
tree359b0146502baa8b804171348b01408908a5de14
parentb208d33b3b27a7f9c7ca2880e8b292d692651343 (diff)
downloadtangerine-wallet-browser-2359062b62cf65f38b36ccb6bb33fa7d15ada1ae.tar.gz
tangerine-wallet-browser-2359062b62cf65f38b36ccb6bb33fa7d15ada1ae.tar.zst
tangerine-wallet-browser-2359062b62cf65f38b36ccb6bb33fa7d15ada1ae.zip
UI confirm screen closes confirmation window on submit or cancel of a tx
-rw-r--r--app/scripts/platforms/extension.js6
-rw-r--r--app/scripts/ui.js8
-rw-r--r--ui/app/components/pages/confirm-transaction-base/confirm-transaction-base.component.js19
3 files changed, 25 insertions, 8 deletions
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) {
diff --git a/ui/app/components/pages/confirm-transaction-base/confirm-transaction-base.component.js b/ui/app/components/pages/confirm-transaction-base/confirm-transaction-base.component.js
index e1bf2210f..2811e6157 100644
--- a/ui/app/components/pages/confirm-transaction-base/confirm-transaction-base.component.js
+++ b/ui/app/components/pages/confirm-transaction-base/confirm-transaction-base.component.js
@@ -8,6 +8,9 @@ import {
INSUFFICIENT_FUNDS_ERROR_KEY,
TRANSACTION_ERROR_KEY,
} from '../../../constants/error-keys'
+import {
+ ENVIRONMENT_TYPE_NOTIFICATION,
+} from '../../../../../app/scripts/lib/enums'
export default class ConfirmTransactionBase extends Component {
static contextTypes = {
@@ -250,8 +253,12 @@ export default class ConfirmTransactionBase extends Component {
} else {
cancelTransaction(txData)
.then(() => {
- clearConfirmTransaction()
- history.push(DEFAULT_ROUTE)
+ if (global.METAMASK_UI_TYPE === ENVIRONMENT_TYPE_NOTIFICATION) {
+ return global.platform.closeCurrentWindow()
+ } else {
+ clearConfirmTransaction()
+ history.push(DEFAULT_ROUTE)
+ }
})
}
}
@@ -264,8 +271,12 @@ export default class ConfirmTransactionBase extends Component {
} else {
sendTransaction(txData)
.then(() => {
- clearConfirmTransaction()
- history.push(DEFAULT_ROUTE)
+ if (global.METAMASK_UI_TYPE === ENVIRONMENT_TYPE_NOTIFICATION) {
+ return global.platform.closeCurrentWindow()
+ } else {
+ clearConfirmTransaction()
+ history.push(DEFAULT_ROUTE)
+ }
})
}
}