From ecd11582c5898c28d78a10d8acc01b11ed6e7de4 Mon Sep 17 00:00:00 2001 From: kshib Date: Fri, 21 Jun 2024 23:57:02 +0530 Subject: [PATCH] fix sorting (for real) --- lib/brain/article_provider.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/brain/article_provider.dart b/lib/brain/article_provider.dart index 584550a..69b62bf 100644 --- a/lib/brain/article_provider.dart +++ b/lib/brain/article_provider.dart @@ -93,7 +93,7 @@ class ArticleProvider { await Future.wait(futures); } newsArticles.addAll(subscriptionArticles); - newsArticles.toList().sort((a, b) => b.publishedAt.compareTo(a.publishedAt)); + newsArticles = (newsArticles.toList()..sort((a, b) => b.publishedAt.compareTo(a.publishedAt))).toSet(); return newsArticles.toList(); }