Skip to content

Commit

Permalink
fix: failed download no error icon
Browse files Browse the repository at this point in the history
  • Loading branch information
KRTirtho committed Jun 17, 2023
1 parent 73c012c commit 1266a3f
Showing 1 changed file with 12 additions and 15 deletions.
27 changes: 12 additions & 15 deletions lib/components/library/user_downloads.dart
Original file line number Diff line number Diff line change
Expand Up @@ -89,21 +89,18 @@ class UserDownloads extends HookConsumerWidget {
),
),
horizontalTitleGap: 10,
trailing: SizedBox(
width: 30,
height: 30,
child: downloadManager.activeItem?.id == track.id
? CircularProgressIndicator(
value: task.data?.progress ?? 0,
)
: hasFailed
? Icon(SpotubeIcons.error, color: Colors.red[400])
: IconButton(
icon: const Icon(SpotubeIcons.close),
onPressed: () {
downloadManager.cancel(track);
}),
),
trailing: downloadManager.activeItem?.id == track.id &&
!hasFailed
? CircularProgressIndicator(
value: task.data?.progress ?? 0,
)
: hasFailed
? Icon(SpotubeIcons.error, color: Colors.red[400])
: IconButton(
icon: const Icon(SpotubeIcons.close),
onPressed: () {
downloadManager.cancel(track);
}),
subtitle: TypeConversionUtils.artists_X_ClickableArtists(
track.artists ?? <Artist>[],
mainAxisAlignment: WrapAlignment.start,
Expand Down

0 comments on commit 1266a3f

Please sign in to comment.