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

Merge pull request #348 from MetaMask/i341

Clear notifications on extension open + guard against negative sends
This commit is contained in:
kumavis 2016-06-28 13:00:37 -07:00 committed by GitHub
commit 7026eca222
4 changed files with 17 additions and 4 deletions

View File

@ -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) {
if (err) {
alert(err.stack)
throw err
}
clearNotifications()
var container = document.getElementById('app-content')
MetaMaskUi({

View File

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

View File

@ -216,6 +216,11 @@ SendTransactionScreen.prototype.onSubmit = function () {
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)) {
message = 'Recipient address is invalid.'
return this.props.dispatch(actions.displayWarning(message))
@ -234,4 +239,3 @@ SendTransactionScreen.prototype.onSubmit = function () {
this.props.dispatch(actions.signTx(txParams))
}