Skip to content

Commit 2c85882

Browse files
szakariassigurdm
andauthored
Update pkg/web_app/lib/src/widget/downloads_chart/widget.dart
Co-authored-by: Sigurd Meldgaard <[email protected]>
1 parent 184cdab commit 2c85882

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

pkg/web_app/lib/src/widget/downloads_chart/widget.dart

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@ void create(HTMLElement element, Map<String, String> options) {
2121
.fuse(json.decoder)
2222
.convert(base64Decode(dataPoints)) as Map<String, dynamic>));
2323

24-
final weeksToDisplay = data.totalWeeklyDownloads.length > 28
25-
? 28
26-
: data.totalWeeklyDownloads.length;
24+
final weeksToDisplay = math.min(28, data.totalWeeklyDownloads.length, 28);
2725

2826
final majorDisplayLists = prepareWeekLists(
2927
data.totalWeeklyDownloads,

0 commit comments

Comments
 (0)