mirror of
https://github.com/elyby/accounts-frontend.git
synced 2025-05-31 14:11:58 +05:30
#48: add/remove accounts from account switcher. Allow authorized users to log in into another account
This commit is contained in:
@@ -26,9 +26,9 @@ export default function accounts(
|
||||
throw new Error('Invalid or empty payload passed for accounts.add');
|
||||
}
|
||||
|
||||
if (!state.available.some((account) => account.id === payload.id)) {
|
||||
state.available = state.available.concat(payload);
|
||||
}
|
||||
state.available = state.available
|
||||
.filter((account) => account.id !== payload.id)
|
||||
.concat(payload);
|
||||
|
||||
return state;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user