@@ -5,13 +5,12 @@ import React, {
55 useEffect ,
66 useState ,
77} from "react" ;
8- import { PlaybackInfo , PlaylistProgress } from "../interfaces/PlaybackInfo" ;
8+ import { PlaybackInfo } from "../interfaces/PlaybackInfo" ;
99import { useQuery } from "@tanstack/react-query" ;
10- import { getPlaybackInfo , getPlaylistProgress } from "../api" ;
10+ import { getPlaybackInfo } from "../api" ;
1111
1212interface PlaybackContext {
1313 playbackInfo ?: PlaybackInfo ;
14- playlistProgress ?: PlaylistProgress ;
1514}
1615
1716export const PlaybackContext = createContext < PlaybackContext > ( { } ) ;
@@ -36,21 +35,9 @@ export const PlaybackContextProvider: FC<PlaybackContextProviderProps> = ({
3635 useEffect ( ( ) => {
3736 setPlaybackRefetchInterval ( playbackInfo ? 10000 : 20000 ) ;
3837 } , [ playbackInfo ] ) ;
39- const { data : playlistProgress } = useQuery < PlaylistProgress | undefined > ( {
40- queryKey : [ "playlistProgress" ] ,
41- queryFn : ( ) => {
42- if ( playbackInfo ?. playlist_id ) {
43- return getPlaylistProgress ( playbackInfo ) ;
44- }
45- } ,
46- retryDelay : playbackRefetchInterval ,
47- refetchInterval : 60000 ,
48- refetchIntervalInBackground : false ,
49- enabled : ! ! playbackInfo ?. playlist_id ,
50- } ) ;
5138
5239 return (
53- < PlaybackContext . Provider value = { { playbackInfo, playlistProgress } } >
40+ < PlaybackContext . Provider value = { { playbackInfo } } >
5441 { children }
5542 </ PlaybackContext . Provider >
5643 ) ;
0 commit comments