mirror of
https://github.com/trezor/trezor-wallet
synced 2024-11-24 09:18:09 +00:00
propagate UPDATE_SELECTED_ACCOUNT only if needed
This commit is contained in:
parent
726a41fb8c
commit
f3ccc617f5
@ -82,9 +82,15 @@ export const updateSelectedValues = (prevState: State, action: Action): AsyncAct
|
||||
|
||||
let needUpdate: boolean = false;
|
||||
Object.keys(payload).forEach((key) => {
|
||||
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;
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
if (needUpdate) {
|
||||
|
Loading…
Reference in New Issue
Block a user