Skip to content

Commit

Permalink
Update state on the UI thread
Browse files Browse the repository at this point in the history
  • Loading branch information
Antonis Lilis committed Apr 2, 2024
1 parent 56c8a86 commit ade4a33
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,9 @@ class SitePreviewViewModel @Inject constructor(
return if (!onSiteFetched.isError) {
val site = siteStore.getSiteBySiteId(remoteSiteId)
if (site == null) {
updateUiState(SiteNotFoundInDbUiState)
withContext(mainDispatcher) {
updateUiState(SiteNotFoundInDbUiState)
}
}
site
} else {
Expand Down

0 comments on commit ade4a33

Please sign in to comment.