Checking inactive state before loading to handle timed out live without location

This commit is contained in:
Maxime NATUREL 2022-05-02 15:30:14 +02:00
parent b0c1ca87df
commit 370b6a81bc
1 changed files with 2 additions and 2 deletions

View File

@ -110,9 +110,9 @@ class LiveLocationShareMessageItemFactory @Inject constructor(
private fun getViewState(liveLocationShareSummaryData: LiveLocationShareSummaryData?): LiveLocationShareViewState { private fun getViewState(liveLocationShareSummaryData: LiveLocationShareSummaryData?): LiveLocationShareViewState {
return when { return when {
liveLocationShareSummaryData?.isActive == null -> LiveLocationShareViewState.Unkwown liveLocationShareSummaryData?.isActive == null -> LiveLocationShareViewState.Unkwown
liveLocationShareSummaryData.isActive && liveLocationShareSummaryData.lastGeoUri.isNullOrEmpty() -> LiveLocationShareViewState.Loading
liveLocationShareSummaryData.isActive.not() || isLiveTimedOut(liveLocationShareSummaryData) -> LiveLocationShareViewState.Inactive liveLocationShareSummaryData.isActive.not() || isLiveTimedOut(liveLocationShareSummaryData) -> LiveLocationShareViewState.Inactive
liveLocationShareSummaryData.isActive && liveLocationShareSummaryData.lastGeoUri.isNullOrEmpty() -> LiveLocationShareViewState.Loading
else -> else ->
LiveLocationShareViewState.Running( LiveLocationShareViewState.Running(
liveLocationShareSummaryData.lastGeoUri.orEmpty(), liveLocationShareSummaryData.lastGeoUri.orEmpty(),