Skip to content

Commit

Permalink
removed comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Jshot117 committed Oct 16, 2024
1 parent 84fa1a9 commit 78c94e4
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions FrontEnd/src/components/DashboardHeader.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,11 @@ const DashboardHeader = ({ handleLogout }) => {
const [loading, setLoading] = useState(true); // Add loading state

useEffect(() => {
const fetchUsername = async () => {
const fetchUsername = async () => {
const user = auth.currentUser;
console.log('Current user:', user);
if (user) {
try {
// Call the leaderboard API to fetch users
const response = await axios.post('http://localhost:3000/userInfo', {
uid: user.uid
}, {
Expand All @@ -26,8 +25,6 @@ const DashboardHeader = ({ handleLogout }) => {
});
const currentUser = await response.data;

// Find the current user in the leaderboard data

if (currentUser) {
setUsername(currentUser.username); // Set username if found
setCurrentUserBadge(currentUser.badges); // Set the badge level (gold, silver, etc.)
Expand Down

0 comments on commit 78c94e4

Please sign in to comment.