From beccdecd168a2ffd3a63adec05ef3f695e1e446b Mon Sep 17 00:00:00 2001 From: Violet Caulfield Date: Mon, 27 Jan 2025 18:44:21 -0600 Subject: [PATCH] set queue first? --- components/Playlist/component.tsx | 19 +++++++++++-------- player/provider.tsx | 3 +-- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/components/Playlist/component.tsx b/components/Playlist/component.tsx index 58a4e092..f1375934 100644 --- a/components/Playlist/component.tsx +++ b/components/Playlist/component.tsx @@ -17,11 +17,14 @@ interface PlaylistProps { navigation: NativeStackNavigationProp } -export default function Playlist(props: PlaylistProps): React.JSX.Element { +export default function Playlist({ + playlist, + navigation +}: PlaylistProps): React.JSX.Element { const { nowPlaying, nowPlayingIsFavorite } = usePlayerContext(); - const { data: tracks, isLoading, refetch } = useItemTracks(props.playlist.Id!); + const { data: tracks, isLoading, refetch } = useItemTracks(playlist.Id!); useEffect(() => { refetch(); @@ -33,12 +36,12 @@ export default function Playlist(props: PlaylistProps): React.JSX.Element { -

{ props.playlist.Name ?? "Untitled Playlist" }

-
{ props.playlist.ProductionYear?.toString() ?? "" }
+

{ playlist.Name ?? "Untitled Playlist" }

+
{ playlist.ProductionYear?.toString() ?? "" }
) @@ -66,7 +69,7 @@ export default function Playlist(props: PlaylistProps): React.JSX.Element { > Total Runtime: - { props.playlist.RunTimeTicks } + { playlist.RunTimeTicks }
) diff --git a/player/provider.tsx b/player/provider.tsx index 3ae5311a..f0f4fc9e 100644 --- a/player/provider.tsx +++ b/player/provider.tsx @@ -136,9 +136,8 @@ const PlayerContextInitializer = () => { const useReorderQueue = useMutation({ mutationFn: async (mutation : QueueOrderMutation) => { - await TrackPlayer.move(mutation.from, mutation.to); - setQueue(mutation.newOrder); + await TrackPlayer.move(mutation.from, mutation.to); } })