mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-08-10 00:16:59 +00:00
fix(desktop): fix feed cold-boot race and remove NWC diagnostic println
Add LaunchedEffect that rescans cache when followedUsers populates after startup, fixing empty feed when contact list arrives after initial scan. Remove diagnostic println from NwcPaymentHandler. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
e690292bbd
commit
562cd3355b
-1
@@ -322,7 +322,6 @@ class NwcPaymentHandler(
|
||||
subId = subId,
|
||||
filters = listOf(filter),
|
||||
onEvent = { event, _ ->
|
||||
println("NWC rpc event received: kind=${event.kind} id=${event.id.take(8)} from=${event.pubKey.take(8)}")
|
||||
if (event is LnZapPaymentResponseEvent && event.requestId() == requestId) {
|
||||
@OptIn(kotlinx.coroutines.DelicateCoroutinesApi::class)
|
||||
kotlinx.coroutines.GlobalScope.launch(kotlinx.coroutines.Dispatchers.IO) {
|
||||
|
||||
@@ -409,6 +409,14 @@ fun FeedScreen(
|
||||
onDispose { viewModel.destroy() }
|
||||
}
|
||||
|
||||
// Rescan cache when followedUsers populates (fixes cold-boot race where
|
||||
// the initial scan runs before the contact list arrives from relays)
|
||||
LaunchedEffect(viewModel, followedUsers) {
|
||||
if (feedMode == FeedMode.FOLLOWING && followedUsers.isNotEmpty()) {
|
||||
viewModel.feedState.refreshSuspended()
|
||||
}
|
||||
}
|
||||
|
||||
val feedState by viewModel.feedState.feedContent.collectAsState()
|
||||
|
||||
// Viewport-aware metadata loading: only fetch for visible notes + buffer
|
||||
|
||||
Reference in New Issue
Block a user