mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-06-29 05:58:57 +02:00
Hard Refresh when the button to refresh is pressed.
This commit is contained in:
@ -39,7 +39,7 @@ fun FeedView(viewModel: FeedViewModel, accountViewModel: AccountViewModel, navCo
|
||||
|
||||
LaunchedEffect(isRefreshing) {
|
||||
if (isRefreshing) {
|
||||
viewModel.refresh()
|
||||
viewModel.hardRefresh()
|
||||
isRefreshing = false
|
||||
}
|
||||
}
|
||||
|
@ -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()
|
||||
|
Reference in New Issue
Block a user