mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Merge pull request #348 from MetaMask/i341
Clear notifications on extension open + guard against negative sends
This commit is contained in:
commit
7026eca222
@ -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…
Reference in New Issue
Block a user