Admin role added, dev side has hot reload again, characters AND groups tied to accounts now.
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
/* eslint-disable no-param-reassign */
|
||||
import { createSlice } from '@reduxjs/toolkit';
|
||||
|
||||
export const CURRENT_VERSION = 4;
|
||||
export const CURRENT_VERSION = 5;
|
||||
|
||||
const INITIAL_STATE = {
|
||||
version: CURRENT_VERSION,
|
||||
@@ -11,6 +11,7 @@ const INITIAL_STATE = {
|
||||
isChecking: true,
|
||||
username: undefined,
|
||||
userEmail: undefined,
|
||||
userRole: undefined,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -26,12 +27,14 @@ export const accountSlice = createSlice({
|
||||
state.accountCache.isChecking = false;
|
||||
state.accountCache.username = action.payload.username;
|
||||
state.accountCache.userEmail = action.payload.email;
|
||||
state.accountCache.userRole = action.payload.role;
|
||||
},
|
||||
setLoggedOut: state => {
|
||||
state.accountCache.isLoggedIn = false;
|
||||
state.accountCache.isChecking = false;
|
||||
state.accountCache.username = undefined;
|
||||
state.accountCache.userEmail = undefined;
|
||||
state.accountCache.userRole = undefined;
|
||||
},
|
||||
reset: () => INITIAL_STATE,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user