mirror of
https://github.com/trezor/trezor-wallet
synced 2025-01-27 08:21:27 +00:00
sort the accounts array
This commit is contained in:
parent
813edd442b
commit
715da870a7
@ -75,6 +75,8 @@ const createAccount = (state: State, account: Account): State => {
|
|||||||
}
|
}
|
||||||
const newState: State = [...state];
|
const newState: State = [...state];
|
||||||
newState.push(account);
|
newState.push(account);
|
||||||
|
// sort the accounts array so the imported accounts always come before discovered accounts
|
||||||
|
newState.sort((a, b) => b.imported - a.imported || a.index - b.index);
|
||||||
return newState;
|
return newState;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user