Skip to content

Commit 4c6c6b3

Browse files
committed
Fix #4
1 parent 6bb8427 commit 4c6c6b3

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

lib/service/cached_news_service.dart

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@ class CachedNewsService {
1717

1818
if (config != null && (_newsFetched(config, startDate, endDate))) {
1919
try {
20-
return await _newsRepository.getNews(startDate, endDate);
20+
final news = await _newsRepository.getNews(startDate, endDate);
21+
22+
news.sort((a, b) => -a.publishedAtUtc.compareTo(b.publishedAtUtc));
23+
24+
return news;
2125
} catch (error, stackTrace) {
2226
ErrorReporter.reportError(error, stackTrace);
2327

0 commit comments

Comments
 (0)