Skip to content

Commit

Permalink
Use dipatcher IO to handle questionnaire submission
Browse files Browse the repository at this point in the history
  • Loading branch information
LZRS committed Sep 18, 2024
1 parent 2f8055b commit 81e8b7d
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ constructor(
context: Context,
onSuccessfulSubmission: (List<IdType>, QuestionnaireResponse) -> Unit,
) {
viewModelScope.launch(SupervisorJob()) {
viewModelScope.launch(dispatcherProvider.io() + SupervisorJob()) {
val questionnaireResponseValid =
validateQuestionnaireResponse(
questionnaire = questionnaire,
Expand Down Expand Up @@ -672,7 +672,7 @@ constructor(
* has an answer.
*/
fun saveDraftQuestionnaire(questionnaireResponse: QuestionnaireResponse) {
viewModelScope.launch {
viewModelScope.launch(dispatcherProvider.io()) {
val questionnaireHasAnswer =
questionnaireResponse.item.any {
it.answer.any { answerComponent -> answerComponent.hasValue() }
Expand Down

0 comments on commit 81e8b7d

Please sign in to comment.