Improves blinking when loading a thread.
This commit is contained in:
@@ -36,8 +36,10 @@ object NostrThreadDataSource : NostrDataSource("SingleThreadFeed") {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun loadThread(noteId: String?) {
|
fun loadThread(noteId: String?) {
|
||||||
eventToWatch = noteId
|
if (eventToWatch != noteId) {
|
||||||
|
eventToWatch = noteId
|
||||||
|
|
||||||
invalidateFilters()
|
invalidateFilters()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,9 +26,10 @@ fun ThreadScreen(noteId: String?, accountViewModel: AccountViewModel, nav: (Stri
|
|||||||
factory = NostrThreadFeedViewModel.Factory(noteId)
|
factory = NostrThreadFeedViewModel.Factory(noteId)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
NostrThreadDataSource.loadThread(noteId)
|
||||||
|
|
||||||
LaunchedEffect(noteId) {
|
LaunchedEffect(noteId) {
|
||||||
NostrThreadDataSource.loadThread(noteId)
|
feedViewModel.invalidateData(true)
|
||||||
feedViewModel.invalidateData()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DisposableEffect(accountViewModel) {
|
DisposableEffect(accountViewModel) {
|
||||||
@@ -37,7 +38,7 @@ fun ThreadScreen(noteId: String?, accountViewModel: AccountViewModel, nav: (Stri
|
|||||||
println("Thread Start")
|
println("Thread Start")
|
||||||
NostrThreadDataSource.loadThread(noteId)
|
NostrThreadDataSource.loadThread(noteId)
|
||||||
NostrThreadDataSource.start()
|
NostrThreadDataSource.start()
|
||||||
feedViewModel.invalidateData()
|
feedViewModel.invalidateData(true)
|
||||||
}
|
}
|
||||||
if (event == Lifecycle.Event.ON_PAUSE) {
|
if (event == Lifecycle.Event.ON_PAUSE) {
|
||||||
println("Thread Stop")
|
println("Thread Stop")
|
||||||
|
|||||||
Reference in New Issue
Block a user