mirror of
https://github.com/elyby/accounts-frontend.git
synced 2025-05-31 14:11:58 +05:30
#48: add account sorting
This commit is contained in:
@@ -30,6 +30,14 @@ export default function accounts(
|
||||
.filter((account) => account.id !== payload.id)
|
||||
.concat(payload);
|
||||
|
||||
state.available.sort((account1, account2) => {
|
||||
if (account1.username === account2.username) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return account1.username > account2.username ? 1 : -1;
|
||||
});
|
||||
|
||||
return state;
|
||||
|
||||
case ACTIVATE:
|
||||
|
||||
Reference in New Issue
Block a user