Checking inactive state before loading to handle timed out live without location
This commit is contained in:
parent
b0c1ca87df
commit
370b6a81bc
|
@ -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(),
|
||||||
|
|
Loading…
Reference in New Issue