allowToast and PreventToast functions

This commit is contained in:
Victor Baranov 2019-01-31 16:31:02 +03:00
parent 706c4ac01c
commit 21864c588b
1 changed files with 11 additions and 4 deletions

View File

@ -132,7 +132,6 @@ class AccountDropdowns extends Component {
this.props.actions.showAccountDetail(address)
if (ifHardwareAcc(keyring)) {
if (isLedger(keyring.type)) {
const hdPaths = getHdPaths()
return new Promise((resolve, reject) => {
this.props.actions.connectHardwareAndUnlockAddress(LEDGER, hdPaths[1].value, address)
@ -147,17 +146,25 @@ class AccountDropdowns extends Component {
if (!this.state.preventToast) {
this.props.actions.displayToast(e)
} else {
this.setState({preventToast: false})
this.allowToast()
}
})
} else {
this.setState({preventToast: true})
this.preventToast()
}
} else {
this.setState({preventToast: true})
this.preventToast()
}
}
allowToast () {
this.setState({preventToast: false})
}
preventToast () {
this.setState({preventToast: true})
}
ifProxyAcc (address, setProxy) {
return new Promise((resolve, reject) => {
this.props.actions.getContract(address)