Hard Refresh when the button to refresh is pressed.

This commit is contained in:
Vitor Pamplona 2023-01-21 13:37:57 -03:00
parent 80f58875bb
commit bb9217466a
2 changed files with 5 additions and 1 deletions

View File

@ -39,7 +39,7 @@ fun FeedView(viewModel: FeedViewModel, accountViewModel: AccountViewModel, navCo
LaunchedEffect(isRefreshing) {
if (isRefreshing) {
viewModel.refresh()
viewModel.hardRefresh()
isRefreshing = false
}
}

View File

@ -58,6 +58,10 @@ abstract class FeedViewModel(val dataSource: NostrDataSource<Note>): ViewModel()
return dataSource.loadTop()
}
fun hardRefresh() {
dataSource.resetFilters()
}
fun refresh() {
viewModelScope.launch(Dispatchers.IO) {
val notes = newListFromDataSource()