Changeset ce45c7a for frontend/src/context
- Timestamp:
- 02/15/26 00:39:55 (5 months ago)
- Branches:
- main
- Children:
- c8baad1
- Parents:
- 85512ff
- File:
-
- 1 edited
-
frontend/src/context/playlistContext.tsx (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
frontend/src/context/playlistContext.tsx
r85512ff rce45c7a 17 17 setCreatedPlaylists: Dispatch<SetStateAction<BasicPlaylist[] | undefined>>; 18 18 isLoading: boolean; 19 refreshPlaylists: ( ) => Promise<void>;19 refreshPlaylists: (addedSong: boolean) => Promise<void>; 20 20 } 21 21 … … 28 28 setCreatedPlaylists: () => {}, 29 29 isLoading: false, 30 refreshPlaylists: async ( ) => {},30 refreshPlaylists: async (addedSong: boolean) => {}, 31 31 }); 32 32 … … 38 38 const [isLoading, setIsLoading] = useState(false); 39 39 40 const fetchCreatedPlaylists = async () => { 41 setIsLoading(true); 40 const fetchCreatedPlaylists = async (addedSong: boolean) => { 41 if (!addedSong) { 42 setIsLoading(true); 43 } 42 44 try { 43 45 const data = await axiosInstance.get<BasicPlaylist[]>("/playlists/user"); … … 52 54 useEffect(() => { 53 55 if (user) { 54 fetchCreatedPlaylists( );56 fetchCreatedPlaylists(false); 55 57 } else { 56 58 setCreatedPlaylists(undefined);
Note:
See TracChangeset
for help on using the changeset viewer.
