mirror of
https://github.com/KRTirtho/spotube.git
synced 2025-09-13 16:05:18 +00:00
fix(play_overlay): show progress indicator on song loading
This commit is contained in:
parent
42b3e111f8
commit
7803a48237
@ -28,14 +28,6 @@ class PlayPauseAction extends Action<PlayPauseIntent> {
|
||||
if (playlist == null) {
|
||||
return null;
|
||||
} else if (!PlaylistQueueNotifier.isPlaying) {
|
||||
// if (playlist.activeTrack is SpotubeTrack &&
|
||||
// (playlist.activeTrack as SpotubeTrack).ytUri.startsWith("http")) {
|
||||
// final track =
|
||||
// Track.fromJson((playlist.activeTrack as SpotubeTrack).toJson());
|
||||
|
||||
// await playlistNotifier.play(track);
|
||||
// } else {
|
||||
// }
|
||||
await playlistNotifier.play();
|
||||
} else {
|
||||
await playlistNotifier.pause();
|
||||
|
@ -27,6 +27,7 @@ class PlayerOverlay extends HookConsumerWidget {
|
||||
PlaylistQueueNotifier.provider.select((s) => s != null),
|
||||
);
|
||||
final playlistNotifier = ref.watch(PlaylistQueueNotifier.notifier);
|
||||
final playlist = ref.watch(PlaylistQueueNotifier.provider);
|
||||
final playing = useStream(PlaylistQueueNotifier.playing).data ??
|
||||
PlaylistQueueNotifier.isPlaying;
|
||||
|
||||
@ -87,12 +88,18 @@ class PlayerOverlay extends HookConsumerWidget {
|
||||
Consumer(
|
||||
builder: (context, ref, _) {
|
||||
return IconButton(
|
||||
icon: Icon(
|
||||
playing
|
||||
? SpotubeIcons.pause
|
||||
: SpotubeIcons.play,
|
||||
color: paletteColor.bodyTextColor,
|
||||
),
|
||||
icon: playlist?.isLoading == true
|
||||
? const SizedBox(
|
||||
height: 20,
|
||||
width: 20,
|
||||
child: CircularProgressIndicator(),
|
||||
)
|
||||
: Icon(
|
||||
playing
|
||||
? SpotubeIcons.pause
|
||||
: SpotubeIcons.play,
|
||||
color: paletteColor.bodyTextColor,
|
||||
),
|
||||
onPressed: Actions.handler<PlayPauseIntent>(
|
||||
context,
|
||||
PlayPauseIntent(ref),
|
||||
|
Loading…
Reference in New Issue
Block a user