Fix token removal
This commit is contained in:
parent
826eea3403
commit
3d18e6b83d
|
@ -53,7 +53,7 @@ workflows:
|
|||
- test-unit
|
||||
- test-e2e-chrome
|
||||
# - test-e2e-firefox
|
||||
- test-integration-mascara-chrome
|
||||
# - test-integration-mascara-chrome
|
||||
# - test-integration-mascara-firefox
|
||||
- test-integration-flat-chrome
|
||||
- test-integration-flat-firefox
|
||||
|
|
|
@ -29,7 +29,7 @@ const generateLostAccountsNotice = require('../lib/lost-accounts-notice')
|
|||
const ConfigScreen = require('./config')
|
||||
import AddTokenScreen from './components/add-token'
|
||||
const ConfirmAddTokenScreen = require('./components/confirm-add-token')
|
||||
const RemoveTokenScreen = require('./remove-token')
|
||||
import RemoveTokenScreen from './remove-token'
|
||||
const AddSuggestedTokenScreen = require('./add-suggested-token')
|
||||
const Import = require('./accounts/import')
|
||||
const ForgetDeviceScreen = require('./components/connect-hardware/forget-screen')
|
||||
|
|
|
@ -1,22 +1,32 @@
|
|||
import ConfirmScreen from './components/confirm'
|
||||
import React from 'react'
|
||||
import { connect } from 'react-redux'
|
||||
import actions from '../../ui/app/actions'
|
||||
|
||||
export default class RemoveTokenScreen extends ConfirmScreen {
|
||||
class RemoveTokenScreen extends ConfirmScreen {
|
||||
render () {
|
||||
return (
|
||||
<ConfirmScreen
|
||||
subtitle="Remove Token"
|
||||
question={`Are you sure you want to remove token "${this.props.symbol}"?`}
|
||||
onCancelClick={() => this.props.dispatch(actions.goHome())}
|
||||
onNoClick={() => this.props.dispatch(actions.goHome())}
|
||||
onCancelClick={() => this.props.goHome()}
|
||||
onNoClick={() => this.props.goHome()}
|
||||
onYesClick={() => {
|
||||
this.props.dispatch(actions.removeToken(this.props.address))
|
||||
this.props.removeToken(this.props.address)
|
||||
.then(() => {
|
||||
this.props.dispatch(actions.goHome())
|
||||
this.props.goHome()
|
||||
})
|
||||
}}
|
||||
/>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
const mapDispatchToProps = dispatch => {
|
||||
return {
|
||||
removeToken: address => dispatch(actions.removeToken(address)),
|
||||
goHome: () => dispatch(actions.goHome()),
|
||||
}
|
||||
}
|
||||
|
||||
export default connect(null, mapDispatchToProps)(RemoveTokenScreen)
|
||||
|
|
Loading…
Reference in New Issue