Post list now supports initial filter to prevent some mismatch

This commit is contained in:
2025-12-06 18:47:50 +08:00
parent 16c7b7e764
commit dff84dde58
5 changed files with 328 additions and 19 deletions

View File

@@ -17,15 +17,16 @@ class PostShuffleScreen extends HookConsumerWidget {
@override
Widget build(BuildContext context, WidgetRef ref) {
const query = PostListQuery(shuffle: true);
final postListState = ref.watch(postListProvider(kShufflePostListId));
final postListNotifier = ref.watch(
postListProvider(kShufflePostListId).notifier,
final cfg = PostListQueryConfig(
id: kShufflePostListId,
initialFilter: query,
);
final postListState = ref.watch(postListProvider(cfg));
final postListNotifier = ref.watch(postListProvider(cfg).notifier);
final cardSwiperController = useMemoized(() => CardSwiperController(), []);
useEffect(() {
postListNotifier.applyFilter(query);
return cardSwiperController.dispose;
}, []);