#48: add/remove accounts from account switcher. Allow authorized users to log in into another account

This commit is contained in:
SleepWalker
2016-11-12 22:31:44 +02:00
parent 5c9a1bc953
commit 586cdfffe4
17 changed files with 243 additions and 140 deletions

View File

@@ -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;