mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-04-10 04:49:25 +02:00
Update lists once every second, not 100ms
This commit is contained in:
parent
fbff78208e
commit
1306270887
@ -20,7 +20,7 @@ object NostrHomeDataSource: NostrDataSource<Note>("HomeFeed") {
|
||||
lateinit var account: Account
|
||||
|
||||
private val cacheListener: (UserState) -> Unit = {
|
||||
resetFilters()
|
||||
invalidateFilters()
|
||||
}
|
||||
|
||||
override fun start() {
|
||||
|
@ -78,6 +78,7 @@ abstract class FeedViewModel(val dataSource: NostrDataSource<Note>): ViewModel()
|
||||
}
|
||||
|
||||
fun refresh() {
|
||||
println("AAA Refresh")
|
||||
val scope = CoroutineScope(Job() + Dispatchers.Default)
|
||||
scope.launch {
|
||||
refreshSuspended()
|
||||
@ -122,7 +123,7 @@ abstract class FeedViewModel(val dataSource: NostrDataSource<Note>): ViewModel()
|
||||
handlerWaiting.set(true)
|
||||
val scope = CoroutineScope(Job() + Dispatchers.Default)
|
||||
scope.launch {
|
||||
delay(100)
|
||||
delay(1000)
|
||||
refresh()
|
||||
handlerWaiting.set(false)
|
||||
}
|
||||
|
@ -72,7 +72,7 @@ open class LnZapFeedViewModel(val dataSource: NostrDataSource<Pair<Note, Note>>)
|
||||
handlerWaiting.set(true)
|
||||
val scope = CoroutineScope(Job() + Dispatchers.Default)
|
||||
scope.launch {
|
||||
delay(100)
|
||||
delay(1000)
|
||||
refresh()
|
||||
handlerWaiting.set(false)
|
||||
}
|
||||
|
@ -87,7 +87,7 @@ open class UserFeedViewModel(val dataSource: NostrDataSource<User>): ViewModel()
|
||||
handlerWaiting.set(true)
|
||||
val scope = CoroutineScope(Job() + Dispatchers.Default)
|
||||
scope.launch {
|
||||
delay(100)
|
||||
delay(1000)
|
||||
refresh()
|
||||
handlerWaiting.set(false)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user