Skip to content

Commit c750c89

Browse files
committed
fix(playlist_page): prevent like and sync buttons from displaying in offline mode
1 parent 1bcaed7 commit c750c89

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

lib/screens/playlist_page.dart

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,9 +261,11 @@ class _PlaylistPageState extends State<PlaylistPage> {
261261
),
262262
if (songsLength > 0)
263263
ShufflePlayButton(songs: _playlist['list'] as List? ?? []),
264-
if (widget.playlistId != null && !isUserCreated)
264+
if (widget.playlistId != null &&
265+
!isUserCreated &&
266+
!offlineMode.value)
265267
_buildLikeButton(primaryColor),
266-
_buildSyncButton(primaryColor),
268+
if (!offlineMode.value) _buildSyncButton(primaryColor),
267269
_buildDownloadButton(),
268270
if (isUserCreated) ...[
269271
_buildShareButton(primaryColor),
@@ -517,6 +519,10 @@ class _PlaylistPageState extends State<PlaylistPage> {
517519
);
518520
}
519521

522+
if (offlineMode.value) {
523+
return const SizedBox.shrink();
524+
}
525+
520526
return IconButton.filledTonal(
521527
icon: Icon(
522528
FluentIcons.arrow_download_24_filled,

0 commit comments

Comments
 (0)