Skip to content

Commit

Permalink
Make question store module more tolerant of unloaded questions (#365)
Browse files Browse the repository at this point in the history
  • Loading branch information
dmfalke authored Jul 18, 2023
1 parent 90248db commit 4ee9a3b
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions packages/libs/wdk-client/src/StoreModules/QuestionStoreModule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -547,9 +547,7 @@ const observeStoreUpdatedParams: QuestionEpic = (
const questionState = state$.value.question.questions[searchName];

if (questionState == null) {
throw new Error(
`Tried to record the parameter values of a nonexistent or unloaded question ${searchName}`
);
return EMPTY;
}

const { globalParamMapping, paramValues: newParamValues } = questionState;
Expand Down Expand Up @@ -580,14 +578,8 @@ const observeLoadGroupCount: QuestionEpic = (action$, state$, { wdkService }) =>
const { searchName } = action.payload;
const questionState = state$.value.question.questions[searchName];

if (questionState == null) {
throw new Error(
`Tried to load group count of a nonexistent or unloaded question ${searchName}`
);
}

if (
questionState.question.properties?.websiteProperties?.includes(
questionState?.question.properties?.websiteProperties?.includes(
'useWizard'
) != true
) {
Expand Down

0 comments on commit 4ee9a3b

Please sign in to comment.