mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-07-01 03:30:39 +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) {
|
LaunchedEffect(isRefreshing) {
|
||||||
if (isRefreshing) {
|
if (isRefreshing) {
|
||||||
viewModel.refresh()
|
viewModel.hardRefresh()
|
||||||
isRefreshing = false
|
isRefreshing = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -58,6 +58,10 @@ abstract class FeedViewModel(val dataSource: NostrDataSource<Note>): ViewModel()
|
|||||||
return dataSource.loadTop()
|
return dataSource.loadTop()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun hardRefresh() {
|
||||||
|
dataSource.resetFilters()
|
||||||
|
}
|
||||||
|
|
||||||
fun refresh() {
|
fun refresh() {
|
||||||
viewModelScope.launch(Dispatchers.IO) {
|
viewModelScope.launch(Dispatchers.IO) {
|
||||||
val notes = newListFromDataSource()
|
val notes = newListFromDataSource()
|
||||||
|
Reference in New Issue
Block a user