Admin role added, dev side has hot reload again, characters AND groups tied to accounts now.

This commit is contained in:
2026-01-28 23:43:02 +00:00
parent 8e92c28272
commit 3cec7abee9
48 changed files with 6139 additions and 45 deletions

View File

@@ -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,
},