🐛 Fix post shuffle
This commit is contained in:
		| @@ -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, | ||||
|   | ||||
		Reference in New Issue
	
	Block a user