aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Serrano <kevgagser@gmail.com>2016-09-02 02:39:08 +0800
committerGitHub <noreply@github.com>2016-09-02 02:39:08 +0800
commita76e198c9c23cfe93346ea7690925fe9d3be5843 (patch)
tree671a308c73f61fc1e2b3fba3cc71ef1d3ac77477
parent32345bda7751f962105bb8bd4ea402f549f30409 (diff)
parent34fd23803d5eea94bd588b805872377edf48a9c6 (diff)
downloadtangerine-wallet-browser-a76e198c9c23cfe93346ea7690925fe9d3be5843.tar.gz
tangerine-wallet-browser-a76e198c9c23cfe93346ea7690925fe9d3be5843.tar.zst
tangerine-wallet-browser-a76e198c9c23cfe93346ea7690925fe9d3be5843.zip
Merge pull request #603 from MetaMask/i566-NoPopupWhenOpen
Don't show popup when sending tx from within metamask
-rw-r--r--CHANGELOG.md1
-rw-r--r--app/scripts/lib/notifications.js30
-rw-r--r--ui/app/actions.js3
-rw-r--r--ui/app/send.js1
4 files changed, 21 insertions, 14 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 462001f51..0e705adef 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -3,6 +3,7 @@
## Current Master
- Fix bug where provider menu did not allow switching to custom network from a custom network.
+- Sending a transaction from within MetaMask no longer triggers a popup.
## 2.10.0 2016-08-29
diff --git a/app/scripts/lib/notifications.js b/app/scripts/lib/notifications.js
index 432ad0445..df4fe73dd 100644
--- a/app/scripts/lib/notifications.js
+++ b/app/scripts/lib/notifications.js
@@ -9,11 +9,12 @@ module.exports = notifications
window.METAMASK_NOTIFIER = notifications
function show () {
- getPopup((popup) => {
- if (popup) {
- return extension.windows.update(popup.id, { focused: true })
- }
+ getWindows((windows) => {
+ if (windows.length > 0) {
+ const win = windows[0]
+ return extension.windows.update(win.id, { focused: true })
+ }
extension.windows.create({
url: 'notification.html',
@@ -25,22 +26,29 @@ function show () {
})
}
-function getPopup(cb) {
-
+function getWindows(cb) {
// Ignore in test environment
if (!extension.windows) {
- return cb(null)
+ return cb()
}
extension.windows.getAll({}, (windows) => {
- let popup = windows.find((win) => {
- return win.type === 'popup'
- })
+ cb(null, windows)
+ })
+}
- cb(popup)
+function getPopup(cb) {
+ getWindows((windows) => {
+ cb(getPopupIn(windows))
})
}
+function getPopupIn(windows) {
+ return windows ? windows.find((win) => {
+ return win.type === 'popup'
+ }) : null
+}
+
function closePopup() {
getPopup((popup) => {
if (!popup) return
diff --git a/ui/app/actions.js b/ui/app/actions.js
index c92138f68..d49223e71 100644
--- a/ui/app/actions.js
+++ b/ui/app/actions.js
@@ -276,8 +276,6 @@ function signMsg (msgData) {
function signTx (txData) {
return (dispatch) => {
- dispatch(actions.showLoadingIndication())
-
web3.eth.sendTransaction(txData, (err, data) => {
dispatch(actions.hideLoadingIndication())
@@ -285,6 +283,7 @@ function signTx (txData) {
dispatch(actions.hideWarning())
dispatch(actions.goHome())
})
+ dispatch(this.showConfTxPage())
}
}
diff --git a/ui/app/send.js b/ui/app/send.js
index 0cc3a032f..cf1b43b1d 100644
--- a/ui/app/send.js
+++ b/ui/app/send.js
@@ -236,7 +236,6 @@ SendTransactionScreen.prototype.onSubmit = function () {
}
this.props.dispatch(actions.hideWarning())
- this.props.dispatch(actions.showLoadingIndication())
var txParams = {
from: this.props.address,