Skip to content

Commit

Permalink
fix: Collection sheet Keeps on loading even the internet is turned off
Browse files Browse the repository at this point in the history
  • Loading branch information
PraneGIT committed Feb 23, 2024
1 parent 5b412a2 commit f89ecb1
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import rx.Subscriber
import rx.android.schedulers.AndroidSchedulers
import rx.plugins.RxJavaPlugins
import rx.schedulers.Schedulers
import java.net.UnknownHostException
import javax.inject.Inject

/**
Expand Down Expand Up @@ -86,6 +87,10 @@ class NewIndividualCollectionSheetViewModel @Inject constructor(private val repo
_newIndividualCollectionSheetUiState.value =
NewIndividualCollectionSheetUiState.ShowError(errorMessage)
}
else if (e is UnknownHostException) {
_newIndividualCollectionSheetUiState.value =
NewIndividualCollectionSheetUiState.ShowError("No internet connection")
}
} catch (throwable: Throwable) {
RxJavaPlugins.getInstance().errorHandler.handleError(e)
}
Expand Down Expand Up @@ -114,6 +119,10 @@ class NewIndividualCollectionSheetViewModel @Inject constructor(private val repo
_newIndividualCollectionSheetUiState.value =
NewIndividualCollectionSheetUiState.ShowError(errorMessage)
}
else if (e is UnknownHostException) {
_newIndividualCollectionSheetUiState.value =
NewIndividualCollectionSheetUiState.ShowError("No internet connection")
}
} catch (throwable: Throwable) {
RxJavaPlugins.getInstance().errorHandler.handleError(e)
}
Expand Down

0 comments on commit f89ecb1

Please sign in to comment.