Adding click handler when finishing load steps #75
This commit is contained in:
parent
7b0f8fa448
commit
936b2bc51c
|
@ -18,7 +18,7 @@ const getSteps = () => [
|
||||||
type Props = {
|
type Props = {
|
||||||
provider: string,
|
provider: string,
|
||||||
network: string,
|
network: string,
|
||||||
onLoadSafeSubmit: () => Promise<void>,
|
onLoadSafeSubmit: (values: Object) => Promise<void>,
|
||||||
}
|
}
|
||||||
|
|
||||||
const iconStyle = {
|
const iconStyle = {
|
||||||
|
|
|
@ -4,9 +4,12 @@ import { connect } from 'react-redux'
|
||||||
import Page from '~/components/layout/Page'
|
import Page from '~/components/layout/Page'
|
||||||
import { buildSafe } from '~/routes/safe/store/actions/fetchSafe'
|
import { buildSafe } from '~/routes/safe/store/actions/fetchSafe'
|
||||||
import { SAFES_KEY, load, saveSafes } from '~/utils/localStorage'
|
import { SAFES_KEY, load, saveSafes } from '~/utils/localStorage'
|
||||||
|
import { SAFELIST_ADDRESS } from '~/routes/routes'
|
||||||
|
import { history } from '~/store'
|
||||||
import selector from './selector'
|
import selector from './selector'
|
||||||
import actions, { type Actions, type UpdateSafe } from './actions'
|
import actions, { type Actions, type UpdateSafe } from './actions'
|
||||||
import Layout from '../components/Layout'
|
import Layout from '../components/Layout'
|
||||||
|
import { FIELD_LOAD_NAME, FIELD_LOAD_ADDRESS } from '../components/fields'
|
||||||
|
|
||||||
type Props = Actions & {
|
type Props = Actions & {
|
||||||
provider: string,
|
provider: string,
|
||||||
|
@ -26,9 +29,19 @@ export const loadSafe = async (safeName: string, safeAddress: string, updateSafe
|
||||||
}
|
}
|
||||||
|
|
||||||
class Open extends React.Component<Props> {
|
class Open extends React.Component<Props> {
|
||||||
onLoadSafeSubmit = async () => {
|
onLoadSafeSubmit = async (values: Object) => {
|
||||||
// call loadSafe
|
try {
|
||||||
// travel to safe route
|
const { updateSafe } = this.props
|
||||||
|
const safeName = values[FIELD_LOAD_NAME]
|
||||||
|
const safeAddress = values[FIELD_LOAD_ADDRESS]
|
||||||
|
|
||||||
|
loadSafe(safeName, safeAddress, updateSafe)
|
||||||
|
const url = `${SAFELIST_ADDRESS}/${safeAddress}`
|
||||||
|
history.push(url)
|
||||||
|
} catch (error) {
|
||||||
|
// eslint-disable-next-line
|
||||||
|
console.log('Error while loading the Safe' + error)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
|
Loading…
Reference in New Issue