@@ -284,7 +284,7 @@ class HomeScreenViewModel(
284284 ) {
285285 val q = query?.trim() ? : " "
286286 if (q != " " ) {
287- viewModelScope.launch {
287+ viewModelScope.launch( Dispatchers . IO ) {
288288 var setLang = preferencesState.value.lang
289289 try {
290290 if (lang != null ) {
@@ -369,7 +369,7 @@ class HomeScreenViewModel(
369369 random : Boolean = false
370370 ) {
371371 loaderJob.cancel()
372- viewModelScope.launch(loaderJob) {
372+ viewModelScope.launch(loaderJob + Dispatchers . IO ) {
373373 var setLang = preferencesState.value.lang
374374 if (title != null || random) {
375375 try {
@@ -540,13 +540,12 @@ class HomeScreenViewModel(
540540 }
541541
542542 /* *
543- * Loads feed, updates the [FeedState] and sets the app status to [WRStatus.FEED_LOADED]
543+ * Loads feed and updates the back stack
544544 *
545- * If an error is encountered, app status is set to [WRStatus.FEED_NETWORK_ERROR] and home screen
546- * text is updated to the error
545+ * If an error is encountered, back stack is set to display the logo instead
547546 */
548547 private fun loadFeed () {
549- viewModelScope.launch(loaderJob) {
548+ viewModelScope.launch(loaderJob + Dispatchers . IO ) {
550549 if (! preferencesState.value.dataSaver && preferencesState.value.feedEnabled) {
551550 _homeScreenState .update { currentState ->
552551 currentState.copy(isLoading = true , loadingProgress = null )
0 commit comments