Changeset 5938bc9 for frontend/src/components/Sidebar.tsx
- Timestamp:
- 02/07/26 14:59:57 (5 months ago)
- Branches:
- main
- Children:
- ebdd3d4
- Parents:
- 591919d
- File:
-
- 1 edited
-
frontend/src/components/Sidebar.tsx (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
frontend/src/components/Sidebar.tsx
r591919d r5938bc9 1 1 import { useEffect, useState } from "react"; 2 2 import axiosInstance from "../api/axiosInstance"; 3 import { useAuth } from "../context/authContext"; 3 4 import type { BasicPlaylist, BasicSong, SidebarProps } from "../utils/types"; 4 5 5 6 const Sidebar = ({ isOpen, onClose }: SidebarProps) => { 7 const { user } = useAuth(); 6 8 const [recentlyListened, setRecentlyListened] = useState<BasicSong[]>([]); 7 9 const [playlists, setPlaylists] = useState<BasicPlaylist[]>([]); … … 25 27 } 26 28 }; 27 fetchData(); 28 }, []); 29 if (user) { 30 fetchData(); 31 } else { 32 setRecentlyListened([]); 33 setPlaylists([]); 34 } 35 }, [user]); 29 36 return ( 30 37 <div
Note:
See TracChangeset
for help on using the changeset viewer.
