🐛 Fix post shuffle

This commit is contained in:
2025-09-06 23:00:26 +08:00
parent 9b68808c77
commit 1ce71f1fa1

View File

@@ -36,9 +36,11 @@ class PostShuffleScreen extends HookConsumerWidget {
bottom:
kBottomControlHeight + MediaQuery.of(context).padding.bottom,
),
child:
(postListState.value?.items.length ?? 0) > 0
? CardSwiper(
child: Builder(
key: ValueKey(postListState.value?.items.length ?? 0),
builder: (context) {
if ((postListState.value?.items.length ?? 0) > 0) {
return CardSwiper(
controller: cardSwiperController,
cardsCount: postListState.value!.items.length,
isLoop: false,
@@ -67,15 +69,17 @@ class PostShuffleScreen extends HookConsumerWidget {
),
);
},
onEnd: () {
onEnd: () async {
if (postListState.value?.hasMore ?? true) {
postListNotifier.fetch(
cursor: postListState.value?.nextCursor,
);
postListNotifier.forceRefresh();
}
},
)
: Center(child: CircularProgressIndicator()),
);
} else {
return Center(child: CircularProgressIndicator());
}
},
),
),
Positioned(
left: 0,