diff --git a/src/routes/tokens/component/Layout.jsx b/src/routes/tokens/component/Layout.jsx index 4949e0e7..9fdaa867 100644 --- a/src/routes/tokens/component/Layout.jsx +++ b/src/routes/tokens/component/Layout.jsx @@ -49,6 +49,10 @@ class TokenLayout extends React.PureComponent { }) } + onReset = () => { + this.setState({ component: undefined }) + } + onRemoveToken = (token: Token) => { const { safeAddress, removeToken } = this.props @@ -57,6 +61,7 @@ class TokenLayout extends React.PureComponent { token={token} safeAddress={safeAddress} removeTokenAction={removeToken} + onReset={this.onReset} />, }) } diff --git a/src/routes/tokens/component/RemoveToken/index.jsx b/src/routes/tokens/component/RemoveToken/index.jsx index 50a70f1c..427be33a 100644 --- a/src/routes/tokens/component/RemoveToken/index.jsx +++ b/src/routes/tokens/component/RemoveToken/index.jsx @@ -13,6 +13,7 @@ type Props = { token: Token, safeAddress: string, removeTokenAction: typeof RemoveTokenAction, + onReset: () => void, } type State = { @@ -21,17 +22,16 @@ type State = { export const REMOVE_TOKEN_RESET_BUTTON_TEXT = 'RESET' -export const removeToken = (safeAddress: string, token: Token, removeTokenAction: typeof RemoveTokenAction) => { +export const removeToken = async (safeAddress: string, token: Token, removeTokenAction: typeof RemoveTokenAction) => removeTokenAction(safeAddress, token) -} class RemoveToken extends React.PureComponent { state = { done: false, } - onReset = () => { - this.setState({ done: false }) + onRemoveReset = () => { + this.setState({ done: false }, this.props.onReset()) } executeRemoveOperation = async () => { @@ -59,7 +59,7 @@ class RemoveToken extends React.PureComponent { finishedButton={finishedButton} onSubmit={this.executeRemoveOperation} steps={steps} - onReset={this.onReset} + onReset={this.onRemoveReset} > { Review }