refactor: last20Messages vollständig aus variablesSlice entfernt
- last20Messages aus variablesSlice entfernt und ausschließlich in dashboardSlice gespeichert - _app.tsx angepasst: last20Messages wird nicht mehr in setVariables gesetzt - loadWindowVariables.ts aktualisiert: last20Messages wird nicht mehr in variables gespeichert - Redux DevTools überprüft, um sicherzustellen, dass last20Messages nicht mehr im falschen Slice erscheint
This commit is contained in:
@@ -6,5 +6,5 @@
|
|||||||
2: Patch oder Hotfix (Bugfixes oder kleine Änderungen).
|
2: Patch oder Hotfix (Bugfixes oder kleine Änderungen).
|
||||||
|
|
||||||
*/
|
*/
|
||||||
const webVersion = "1.6.89";
|
const webVersion = "1.6.90";
|
||||||
export default webVersion;
|
export default webVersion;
|
||||||
|
|||||||
@@ -19,12 +19,16 @@ function MyApp({ Component, pageProps }: AppProps) {
|
|||||||
const loadAndStoreVariables = async () => {
|
const loadAndStoreVariables = async () => {
|
||||||
try {
|
try {
|
||||||
const variables = await loadWindowVariables();
|
const variables = await loadWindowVariables();
|
||||||
if (!variables) throw new Error("Sitzungsfehler"); // Fehler werfen, wenn keine Variablen geladen werden
|
if (!variables) throw new Error("Sitzungsfehler");
|
||||||
store.dispatch(setVariables(variables));
|
|
||||||
setSessionExpired(false); // Sitzung ist aktiv
|
// last20Messages entfernen, falls es noch in variables existiert
|
||||||
|
const { last20Messages, ...restVariables } = variables;
|
||||||
|
|
||||||
|
store.dispatch(setVariables(restVariables));
|
||||||
|
setSessionExpired(false);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("Fehler beim Laden der Sitzung:", error);
|
console.error("Fehler beim Laden der Sitzung:", error);
|
||||||
setSessionExpired(true); // Sitzung ist abgelaufen oder fehlgeschlagen
|
setSessionExpired(true);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -146,6 +146,7 @@ const variablesSlice = createSlice({
|
|||||||
(state[key] as VariablesState[keyof VariablesState]) = value;
|
(state[key] as VariablesState[keyof VariablesState]) = value;
|
||||||
},
|
},
|
||||||
setVariables(state, action: PayloadAction<Partial<VariablesState>>) {
|
setVariables(state, action: PayloadAction<Partial<VariablesState>>) {
|
||||||
|
//console.log("setVariables aufgerufen mit:", action.payload);
|
||||||
Object.entries(action.payload).forEach(([key, value]) => {
|
Object.entries(action.payload).forEach(([key, value]) => {
|
||||||
(state[
|
(state[
|
||||||
key as keyof VariablesState
|
key as keyof VariablesState
|
||||||
|
|||||||
Reference in New Issue
Block a user