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