Skip to content

Commit 8e66991

Browse files
committed
Improve live match fetching logic
1 parent 25cab3e commit 8e66991

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: live/src/main/java/dev/ricknout/rugbyranker/live/ui/LiveMatchViewModel.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ open class LiveMatchViewModel(
4343
fun refreshLiveMatches(showRefresh: Boolean = true, onComplete: (success: Boolean) -> Unit) {
4444
if (showRefresh) _refreshingLiveMatches.value = true
4545
repository.fetchLatestMatchesAsync(sport, status, viewModelScope) { success, matches ->
46-
if (success) _liveMatches.value = matches
46+
if (success || _liveMatches.value == null) _liveMatches.value = matches
4747
if (showRefresh) _refreshingLiveMatches.value = false
4848
onComplete(success)
4949
}

0 commit comments

Comments
 (0)