Skip to content

Commit

Permalink
Initialize with 'All' filter
Browse files Browse the repository at this point in the history
  • Loading branch information
jocmp committed Feb 12, 2025
1 parent e496504 commit b4c69bb
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,10 @@ class ArticleScreenViewModel(
}
}

fun initialize(onComplete: () -> Unit) {
fun initialize(
filter: ArticleFilter = ArticleFilter.default(),
onComplete: () -> Unit
) {
refreshJob?.cancel()

refreshJob = viewModelScope.launch(Dispatchers.IO) {
Expand All @@ -266,7 +269,7 @@ class ArticleScreenViewModel(
}

fun refreshFeed(onComplete: () -> Unit) {
initialize {
initialize(latestFilter) {
updateArticlesSince()
onComplete()
}
Expand Down

0 comments on commit b4c69bb

Please sign in to comment.