Merge pull request #348 from MetaMask/i341

Clear notifications on extension open + guard against negative sends
feature/default_network_editable
kumavis 9 years ago committed by GitHub
commit 7026eca222
  1. 10
      app/scripts/popup.js
  2. 1
      ui/app/app.js
  3. 6
      ui/app/send.js

@ -65,12 +65,22 @@ function getCurrentDomain (cb) {
}) })
} }
function clearNotifications(){
chrome.notifications.getAll(function (object) {
for (let notification in object){
chrome.notifications.clear(notification)
}
})
}
function setupApp (err, opts) { function setupApp (err, opts) {
if (err) { if (err) {
alert(err.stack) alert(err.stack)
throw err throw err
} }
clearNotifications()
var container = document.getElementById('app-content') var container = document.getElementById('app-content')
MetaMaskUi({ MetaMaskUi({

@ -355,4 +355,3 @@ App.prototype.toggleMetamaskActive = function () {
this.props.dispatch(actions.lockMetamask(false)) this.props.dispatch(actions.lockMetamask(false))
} }
} }

@ -216,6 +216,11 @@ SendTransactionScreen.prototype.onSubmit = function () {
return this.props.dispatch(actions.displayWarning(message)) return this.props.dispatch(actions.displayWarning(message))
} }
if (input < 0) {
message = 'Can not send negative amounts of ETH.'
return this.props.dispatch(actions.displayWarning(message))
}
if ((!util.isValidAddress(recipient) && !txData) || (!recipient && !txData)) { if ((!util.isValidAddress(recipient) && !txData) || (!recipient && !txData)) {
message = 'Recipient address is invalid.' message = 'Recipient address is invalid.'
return this.props.dispatch(actions.displayWarning(message)) return this.props.dispatch(actions.displayWarning(message))
@ -234,4 +239,3 @@ SendTransactionScreen.prototype.onSubmit = function () {
this.props.dispatch(actions.signTx(txParams)) this.props.dispatch(actions.signTx(txParams))
} }

Loading…
Cancel
Save