mirror of
https://github.com/trezor/trezor-wallet
synced 2024-11-24 01:08:27 +00:00
propagate UPDATE_SELECTED_ACCOUNT only if needed
This commit is contained in:
parent
726a41fb8c
commit
f3ccc617f5
@ -82,8 +82,14 @@ export const updateSelectedValues = (prevState: State, action: Action): AsyncAct
|
||||
|
||||
let needUpdate: boolean = false;
|
||||
Object.keys(payload).forEach((key) => {
|
||||
if (payload[key] !== state.selectedAccount[key]) {
|
||||
needUpdate = true;
|
||||
if (Array.isArray(payload[key])) {
|
||||
if (Array.isArray(state.selectedAccount[key]) && payload[key].length !== state.selectedAccount[key].length) {
|
||||
needUpdate = true;
|
||||
}
|
||||
} else {
|
||||
if (payload[key] !== state.selectedAccount[key]) {
|
||||
needUpdate = true;
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user