Fallback to empty list if budgets or accounts are unset
This commit is contained in:
parent
132ae75755
commit
b6628dd8cb
@ -66,10 +66,10 @@ export const store = createStore<State>({
|
|||||||
state.CurrentAccountID = restoredState.CurrentAccountID;
|
state.CurrentAccountID = restoredState.CurrentAccountID;
|
||||||
state.ShowMenu = restoredState.ShowMenu;
|
state.ShowMenu = restoredState.ShowMenu;
|
||||||
|
|
||||||
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]);
|
||||||
}
|
}
|
||||||
for (const account of restoredState.Accounts) {
|
for (const account of restoredState.Accounts || []) {
|
||||||
state.Accounts.set(account[0], account[1]);
|
state.Accounts.set(account[0], account[1]);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user