Ignore:
Timestamp:
02/15/26 00:39:55 (5 months ago)
Author:
Dimitar Arsov <dimitararsov04@…>
Branches:
main
Children:
c8baad1
Parents:
85512ff
Message:

add song to playlist

File:
1 edited

Legend:

Unmodified
Added
Removed
  • frontend/src/context/playlistContext.tsx

    r85512ff rce45c7a  
    1717  setCreatedPlaylists: Dispatch<SetStateAction<BasicPlaylist[] | undefined>>;
    1818  isLoading: boolean;
    19   refreshPlaylists: () => Promise<void>;
     19  refreshPlaylists: (addedSong: boolean) => Promise<void>;
    2020}
    2121
     
    2828  setCreatedPlaylists: () => {},
    2929  isLoading: false,
    30   refreshPlaylists: async () => {},
     30  refreshPlaylists: async (addedSong: boolean) => {},
    3131});
    3232
     
    3838  const [isLoading, setIsLoading] = useState(false);
    3939
    40   const fetchCreatedPlaylists = async () => {
    41     setIsLoading(true);
     40  const fetchCreatedPlaylists = async (addedSong: boolean) => {
     41    if (!addedSong) {
     42      setIsLoading(true);
     43    }
    4244    try {
    4345      const data = await axiosInstance.get<BasicPlaylist[]>("/playlists/user");
     
    5254  useEffect(() => {
    5355    if (user) {
    54       fetchCreatedPlaylists();
     56      fetchCreatedPlaylists(false);
    5557    } else {
    5658      setCreatedPlaylists(undefined);
Note: See TracChangeset for help on using the changeset viewer.