From df58c666ae49f2e95c9e06bb05eeb7a20453f7bf Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 15 May 2026 20:21:24 +0000 Subject: [PATCH] fix(home): restore pull-to-refresh on home feeds The `onRefresh: () -> Unit` parameter in the second `RefresheableBox` overload was shadowed by a local `val onRefresh` of the same name. The recursive `onRefresh()` call inside the launched coroutine therefore re-invoked the local wrapper instead of the caller's callback, so pulling down on the home feed never actually triggered `feedState.invalidateData()` or the DVM refresh. Rename the local wrapper to `onRefreshWrapped` so the parameter remains visible inside the lambda. --- .../com/vitorpamplona/amethyst/ui/feeds/RefresheableBox.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/feeds/RefresheableBox.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/feeds/RefresheableBox.kt index b18dc7d93..3c18d5c9c 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/feeds/RefresheableBox.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/feeds/RefresheableBox.kt @@ -73,7 +73,7 @@ fun RefresheableBox( ) { var isRefreshing by remember { mutableStateOf(false) } val scope = rememberCoroutineScope() - val onRefresh: () -> Unit = { + val onRefreshWrapped: () -> Unit = { isRefreshing = true scope.launch { onRefresh() @@ -84,7 +84,7 @@ fun RefresheableBox( PullToRefreshBox( isRefreshing = isRefreshing, - onRefresh = onRefresh, + onRefresh = onRefreshWrapped, modifier = Modifier.fillMaxSize(), content = content, )