mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-10-05 11:18:24 +00:00
fix: make Discover's pull-to-refresh re-issue the discovery REQs
Pull-to-refresh only re-read the cache (invalidateData), so when cached beats were stale it showed the loss instead of fixing it. The DVM tab's refresh now also invalidates the discovery assembler, re-issuing the 31990 REQ and both heartbeat streams (global + outbox batches) with fresh rolling windows — beats repopulate in seconds instead of whenever the open REQs happen to deliver.
This commit is contained in:
+12
-1
@@ -278,7 +278,18 @@ private fun DiscoverPages(
|
||||
HorizontalPager(state = pagerState) { page ->
|
||||
if (page >= 0 && page < feedTabs.size) {
|
||||
val tab = feedTabs[page]
|
||||
RefresheableBox(tab.feedState, true) {
|
||||
RefresheableBox(
|
||||
onRefresh = {
|
||||
tab.feedState.invalidateData()
|
||||
// The DVM tab's freshness gate lives or dies with beat delivery, and
|
||||
// invalidateData only re-reads the cache — re-issue the discovery REQs
|
||||
// (31990 + both heartbeat streams) with fresh rolling windows so refresh
|
||||
// actually fetches.
|
||||
if (tab.feedState == accountViewModel.feedStates.discoverDVMs) {
|
||||
accountViewModel.dataSources().discovery.invalidateFilters()
|
||||
}
|
||||
},
|
||||
) {
|
||||
if (tab.useGridLayout) {
|
||||
SaveableGridFeedContentState(tab.feedState, scrollStateKey = tab.scrollStateKey) { listState ->
|
||||
RenderDiscoverFeed(
|
||||
|
||||
Reference in New Issue
Block a user