From 2908d00b0fca211502ff6eac48d7925a16c63976 Mon Sep 17 00:00:00 2001 From: emkartal1 Date: Sun, 26 Nov 2023 17:45:48 +0100 Subject: [PATCH] fix feeds pagination :hammer: --- Sources/justMUSIC/lib/services/PostService.dart | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Sources/justMUSIC/lib/services/PostService.dart b/Sources/justMUSIC/lib/services/PostService.dart index 015741f..a180f40 100644 --- a/Sources/justMUSIC/lib/services/PostService.dart +++ b/Sources/justMUSIC/lib/services/PostService.dart @@ -51,7 +51,9 @@ class PostService { .limit(limit) .get(); - MyApp.postViewModel.lastPostDiscovery = response.docs.last; + MyApp.postViewModel.lastPostDiscovery = response.docs.isNotEmpty + ? response.docs.last + : MyApp.postViewModel.lastPostDiscovery; var filteredPosts = response.docs.where((doc) { String user = doc["user_id"];