Skip to content

Commit

Permalink
Fix TypeScript errors
Browse files Browse the repository at this point in the history
  • Loading branch information
eryanph committed Dec 18, 2023
1 parent a6ab6c1 commit ebdbb02
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/store/databases/reducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down
2 changes: 1 addition & 1 deletion src/store/databases/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export interface DBState {
dbName: string;
formName: string;
alias: Array<string>;
formModes: Array<any>;
formModes?: Array<any>;
formAccessModes: Array<any>;
}>;
loadedForm: string;
Expand Down

0 comments on commit ebdbb02

Please sign in to comment.