Skip to content

Commit

Permalink
Notify to not delay the update of UI
Browse files Browse the repository at this point in the history
- updateDependentQuestionnaireResponseItems can evaluate
  X-FHIR-Query expression which can delay the update of UI
  for 1-2 seconds depending on the retrieved resource size.

- In the case of clicking next page after selecting an
  answer that shows the next pages based on skip logic
  (tapping this and that very quickly). We notify the UI
  pages immediately, then once the X-FHIR-Query expression
  is processed (1-2 seconds), we notify the UI again.
  Without this changes, when the user taps next page, the
  next pages that is supposed to be shown by skip logic
  will be shown late enough that the user don't see it,
  but if the user taps previous page button, user will see
  the shown pages decided by skip logic. And that looks
  like a bug.
  • Loading branch information
FikriMilano committed Aug 8, 2023
1 parent 648ef72 commit 9d33869
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,7 @@ internal class QuestionnaireViewModel(application: Application, state: SavedStat
questionnaireResponseItem.addNestedItemsToAnswer(questionnaireItem)
}
modifiedQuestionnaireResponseItemSet.add(questionnaireResponseItem)
modificationCount.update { it + 1 }

viewModelScope.launch(Dispatchers.IO) {
updateDependentQuestionnaireResponseItems(questionnaireItem, questionnaireResponseItem)
Expand Down

0 comments on commit 9d33869

Please sign in to comment.