mirror of
https://github.com/trezor/trezor-wallet
synced 2025-02-13 16:42:01 +00:00
remove unnecesary condition from WalletAction.observe
This commit is contained in:
parent
13b49c32b5
commit
89d8485bbd
@ -169,15 +169,11 @@ export const observe = (prevState: State, action: Action): PayloadAction<boolean
|
|||||||
|
|
||||||
const state: State = getState();
|
const state: State = getState();
|
||||||
|
|
||||||
const locationChanged = reducerUtils.observeChanges(
|
|
||||||
prevState.router.location,
|
|
||||||
state.router.location
|
|
||||||
);
|
|
||||||
const device = reducerUtils.getSelectedDevice(state);
|
const device = reducerUtils.getSelectedDevice(state);
|
||||||
const selectedDeviceChanged = reducerUtils.observeChanges(state.wallet.selectedDevice, device);
|
const selectedDeviceChanged = reducerUtils.observeChanges(state.wallet.selectedDevice, device);
|
||||||
|
|
||||||
// handle devices state change (from trezor-connect events or location change)
|
// handle devices state change (from trezor-connect events or location change)
|
||||||
if (locationChanged || selectedDeviceChanged) {
|
if (selectedDeviceChanged) {
|
||||||
if (device && deviceUtils.isSelectedDevice(state.wallet.selectedDevice, device)) {
|
if (device && deviceUtils.isSelectedDevice(state.wallet.selectedDevice, device)) {
|
||||||
dispatch({
|
dispatch({
|
||||||
type: WALLET.UPDATE_SELECTED_DEVICE,
|
type: WALLET.UPDATE_SELECTED_DEVICE,
|
||||||
|
Loading…
Reference in New Issue
Block a user