1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-10-22 11:22:43 +02:00

Merge pull request #603 from MetaMask/i566-NoPopupWhenOpen

Don't show popup when sending tx from within metamask
This commit is contained in:
Kevin Serrano 2016-09-01 11:39:08 -07:00 committed by GitHub
commit a76e198c9c
4 changed files with 22 additions and 15 deletions

View File

@ -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

View File

@ -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(popup)
cb(null, windows)
})
}
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

View File

@ -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())
}
}

View File

@ -236,7 +236,6 @@ SendTransactionScreen.prototype.onSubmit = function () {
}
this.props.dispatch(actions.hideWarning())
this.props.dispatch(actions.showLoadingIndication())
var txParams = {
from: this.props.address,