1
0
mirror of https://github.com/trezor/trezor-wallet synced 2024-12-01 04:38:15 +00:00

Clear for signature

This commit is contained in:
Vladimir Volek 2018-10-19 00:55:16 +02:00
parent 50176ebbdf
commit 954ad18f8e
4 changed files with 17 additions and 3 deletions

View File

@ -62,7 +62,6 @@ export const verify = (
signature, signature,
hex, hex,
}; };
console.log('input', input);
const response = await TrezorConnect.ethereumVerifyMessage(input); const response = await TrezorConnect.ethereumVerifyMessage(input);
if (response && response.success) { if (response && response.success) {
@ -89,4 +88,12 @@ export const verify = (
}, },
}); });
} }
};
export const clear = (): ThunkAction => (dispatch: Dispatch): void => {
dispatch({
type: SIGN_VERIFY.CLEAR,
signature: '',
});
}; };

View File

@ -1,4 +1,5 @@
/* @flow */ /* @flow */
export const SIGN_SUCCESS: 'sign__verify__sign__success' = 'sign__verify__sign__success'; export const SIGN_SUCCESS: 'sign__verify__sign__success' = 'sign__verify__sign__success';
export const VERIFY_SUCCESS: 'sign__verify__verify__success' = 'sign__verify__verify__success'; export const VERIFY_SUCCESS: 'sign__verify__verify__success' = 'sign__verify__verify__success';
export const CLEAR: 'sign__verify__sign__clear' = 'sign__verify__sign__clear';

View File

@ -11,7 +11,7 @@ export type State = {
} }
export const initialState: State = { export const initialState: State = {
signature: null, signature: '',
}; };
export default (state: State = initialState, action: Action): State => { export default (state: State = initialState, action: Action): State => {
@ -28,6 +28,11 @@ export default (state: State = initialState, action: Action): State => {
signature: action.signature, signature: action.signature,
}; };
case SIGN_VERIFY.CLEAR:
return {
...initialState,
};
default: default:
return state; return state;
} }

View File

@ -80,6 +80,7 @@ class SignVerify extends Component {
this.setState({ this.setState({
signMessage: '', signMessage: '',
}); });
this.props.signVerifyActions.clear();
} }
clearVerify = () => { clearVerify = () => {