Save and restore ExpandMenu state

This commit is contained in:
Jan Bader 2022-02-08 21:14:44 +00:00
parent 33bdfaddc4
commit 0579ec5106

View File

@ -55,6 +55,7 @@ export const store = createStore<State>({
state.Session = restoredState.Session; state.Session = restoredState.Session;
state.CurrentBudgetID = restoredState.CurrentBudgetID; state.CurrentBudgetID = restoredState.CurrentBudgetID;
state.ShowMenu = restoredState.ShowMenu; state.ShowMenu = restoredState.ShowMenu;
state.ExpandMenu = restoredState.ExpandMenu;
for (const budget of restoredState.Budgets || []) { for (const budget of restoredState.Budgets || []) {
state.Budgets.set(budget[0], budget[1]); state.Budgets.set(budget[0], budget[1]);
@ -176,6 +177,7 @@ store.subscribe((mutation, state) => {
// Accounts: [...state.Accounts], // Accounts: [...state.Accounts],
CurrentBudgetID: state.CurrentBudgetID, CurrentBudgetID: state.CurrentBudgetID,
//CurrentAccountID: state.CurrentAccountID, //CurrentAccountID: state.CurrentAccountID,
ExpandMenu: state.ExpandMenu,
ShowMenu: state.ShowMenu ShowMenu: state.ShowMenu
} }
localStorage.setItem("store", JSON.stringify(persistedState)); localStorage.setItem("store", JSON.stringify(persistedState));