mirror of
https://github.com/elyby/accounts-frontend.git
synced 2025-05-31 14:11:58 +05:30
#48: reset accounts state on logout
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { ADD, REMOVE, ACTIVATE, UPDATE_TOKEN } from './actions';
|
||||
import { ADD, REMOVE, ACTIVATE, RESET, UPDATE_TOKEN } from './actions';
|
||||
|
||||
/**
|
||||
* @typedef {AccountsState}
|
||||
@@ -50,6 +50,9 @@ export default function accounts(
|
||||
active: payload
|
||||
};
|
||||
|
||||
case RESET:
|
||||
return accounts(undefined, {});
|
||||
|
||||
case REMOVE:
|
||||
if (!payload || !payload.id) {
|
||||
throw new Error('Invalid or empty payload passed for accounts.remove');
|
||||
|
||||
Reference in New Issue
Block a user