diff --git a/src/store/databases/reducer.ts b/src/store/databases/reducer.ts index 47b17eb..304ca23 100644 --- a/src/store/databases/reducer.ts +++ b/src/store/databases/reducer.ts @@ -269,7 +269,10 @@ export default function databaseReducer( }; case APPEND_CONFIGURED_FORM: return produce(state, (draft: DBState) => { - draft.forms[action.payload.formIndex].formModes.push(action.payload.data); + const formModes = draft.forms[action.payload.formIndex].formModes; + if (formModes !== undefined) { + formModes.push(action.payload.data); + } }); case UNCONFIG_FORM: return produce(state, (draft: DBState) => { diff --git a/src/store/databases/types.ts b/src/store/databases/types.ts index 30a74f4..228d843 100644 --- a/src/store/databases/types.ts +++ b/src/store/databases/types.ts @@ -120,7 +120,7 @@ export interface DBState { dbName: string; formName: string; alias: Array; - formModes: Array; + formModes?: Array; formAccessModes: Array; }>; loadedForm: string;