Skip to content

Commit 21c3446

Browse files
committed
Show top 6 packages in trending
1 parent 714314a commit 21c3446

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

app/lib/search/top_packages.dart

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,11 @@ class TopPackages {
9292
}
9393

9494
List<PackageView> trending() {
95-
return _randomSelection(_trending, 6);
95+
final trending = _trending.value;
96+
if (trending != null && trending.length > 6) {
97+
return trending.sublist(0, 6);
98+
}
99+
return [];
96100
}
97101

98102
List<PackageView> _randomSelection(

0 commit comments

Comments
 (0)