mirror of
https://github.com/trezor/trezor-wallet
synced 2024-11-24 09:18:09 +00:00
dispose and initialization selectedAccount view
This commit is contained in:
parent
47af92ae2c
commit
b67315e180
@ -55,6 +55,20 @@ export const updateSelectedValues = (prevState: State, action: Action): AsyncAct
|
|||||||
|| prevState.pending !== state.pending
|
|| prevState.pending !== state.pending
|
||||||
|| prevState.web3 !== state.web3) {
|
|| prevState.web3 !== state.web3) {
|
||||||
|
|
||||||
|
|
||||||
|
if (locationChange) {
|
||||||
|
|
||||||
|
if (prevLocation) {
|
||||||
|
// save form data to session storage
|
||||||
|
// TODO: move to state.sendForm on change event
|
||||||
|
if (prevLocation.state.send) {
|
||||||
|
SessionStorageActions.save(prevState.router.location.pathname, state.sendForm);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// dispose current account view
|
||||||
|
dispatch( dispose() );
|
||||||
|
}
|
||||||
|
|
||||||
const account = stateUtils.getSelectedAccount(state);
|
const account = stateUtils.getSelectedAccount(state);
|
||||||
const network = stateUtils.getSelectedNetwork(state);
|
const network = stateUtils.getSelectedNetwork(state);
|
||||||
const discovery = stateUtils.getDiscoveryProcess(state);
|
const discovery = stateUtils.getDiscoveryProcess(state);
|
||||||
@ -84,23 +98,9 @@ export const updateSelectedValues = (prevState: State, action: Action): AsyncAct
|
|||||||
type: ACCOUNT.UPDATE_SELECTED_ACCOUNT,
|
type: ACCOUNT.UPDATE_SELECTED_ACCOUNT,
|
||||||
payload,
|
payload,
|
||||||
});
|
});
|
||||||
}
|
|
||||||
|
|
||||||
if (locationChange) {
|
// initialize SendFormReducer
|
||||||
|
if (location.state.send && getState().sendForm.currency === "") {
|
||||||
if (prevLocation) {
|
|
||||||
// save form data to session storage
|
|
||||||
// TODO: move to state.sendForm on change event
|
|
||||||
if (prevLocation.state.send) {
|
|
||||||
SessionStorageActions.save(prevState.router.location.pathname, state.sendForm);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
dispatch( dispose() );
|
|
||||||
}
|
|
||||||
|
|
||||||
if (needUpdate) {
|
|
||||||
if (location.state.send && state.sendForm.currency === "") {
|
|
||||||
dispatch( SendFormActions.init( SessionStorageActions.load(location.pathname) ) );
|
dispatch( SendFormActions.init( SessionStorageActions.load(location.pathname) ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user