remove unnecesary condition from WalletAction.observe

pull/500/head
Szymon Lesisz 5 years ago
parent 13b49c32b5
commit 89d8485bbd

@ -169,15 +169,11 @@ export const observe = (prevState: State, action: Action): PayloadAction<boolean
const state: State = getState();
const locationChanged = reducerUtils.observeChanges(
prevState.router.location,
state.router.location
);
const device = reducerUtils.getSelectedDevice(state);
const selectedDeviceChanged = reducerUtils.observeChanges(state.wallet.selectedDevice, device);
// handle devices state change (from trezor-connect events or location change)
if (locationChanged || selectedDeviceChanged) {
if (selectedDeviceChanged) {
if (device && deviceUtils.isSelectedDevice(state.wallet.selectedDevice, device)) {
dispatch({
type: WALLET.UPDATE_SELECTED_DEVICE,

Loading…
Cancel
Save