Fallback to empty list if budgets or accounts are unset

This commit is contained in:
Jan Bader 2022-02-01 20:23:46 +00:00
parent 132ae75755
commit b6628dd8cb

View File

@ -66,10 +66,10 @@ export const store = createStore<State>({
state.CurrentAccountID = restoredState.CurrentAccountID;
state.ShowMenu = restoredState.ShowMenu;
for (const budget of restoredState.Budgets) {
for (const budget of restoredState.Budgets || []) {
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]);
}
},