From 4ebbda1b14be25d7f10a709521c1d52a380b2ca1 Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Wed, 7 Jan 2026 01:55:10 +0800 Subject: [PATCH] :bug: Trying to fix timeline duplicate posts, close #227 --- lib/pods/timeline.dart | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/pods/timeline.dart b/lib/pods/timeline.dart index 3eaa6b90..d4a4b683 100644 --- a/lib/pods/timeline.dart +++ b/lib/pods/timeline.dart @@ -62,7 +62,14 @@ class ActivityListNotifier .where((e) => e.type.startsWith('posts.')) .map((e) => e.createdAt) .reduce((a, b) => a.isBefore(b) ? a : b); - cursor = latestCreatedAt.toUtc().toIso8601String(); + if (cursor != null) { + final prevCursor = DateTime.tryParse(cursor!); + if (prevCursor != null && prevCursor.isAfter(latestCreatedAt)) { + cursor = latestCreatedAt.toUtc().toIso8601String(); + } + } else { + cursor = latestCreatedAt.toUtc().toIso8601String(); + } } return items;