From e80be7e0d907451576ff6a19527a64d03b2367a6 Mon Sep 17 00:00:00 2001 From: Saurabh Kumar Bajpai Date: Wed, 17 Jun 2026 11:38:27 +0530 Subject: [PATCH 1/2] fix: prevent duplicate notification panels on rapid bell clicks - Add useRef debounce guard to prevent AnimatePresence panel stacking - Use functional state update for reliable toggle behavior --- src/components/layout/Navbar.jsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/components/layout/Navbar.jsx b/src/components/layout/Navbar.jsx index 4adaf18..68c6f75 100644 --- a/src/components/layout/Navbar.jsx +++ b/src/components/layout/Navbar.jsx @@ -22,6 +22,7 @@ export const Navbar = ({ toggleMobile, isMobileOpen }) => { return "Good evening"; })(); const notificationRef = useRef(null); + const notificationToggleRef = useRef(false); const navigate = useNavigate(); const hasSearchQuery = searchQuery.trim().length > 0; @@ -283,7 +284,12 @@ export const Navbar = ({ toggleMobile, isMobileOpen }) => { setShowNotifications(!showNotifications)} + onClick={() => { + if (notificationToggleRef.current) return; + notificationToggleRef.current = true; + setShowNotifications(prev => !prev); + setTimeout(() => { notificationToggleRef.current = false; }, 300); + }} className="p-2 rounded-xl border border-slate-200/50 dark:border-slate-800/50 bg-white/80 dark:bg-slate-900/80 backdrop-blur-md text-slate-700 dark:text-slate-300 w-10 h-10 flex items-center justify-center cursor-pointer hover:shadow-sm relative" > From e6c8783346abc5b724ded0bfc6994bf873dbb3b8 Mon Sep 17 00:00:00 2001 From: Saurabh Kumar Bajpai Date: Wed, 17 Jun 2026 12:56:44 +0530 Subject: [PATCH 2/2] fix: encode GitHub username in events/repos API URLs (#567) The GitRank page was using raw userData.githubUsername in API URLs without encoding. If a username contains special characters, the API call fails silently, zeroing the streak. Wrapped with encodeURIComponent to match AuthContext's pattern. --- src/pages/GitRank.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/GitRank.jsx b/src/pages/GitRank.jsx index 8e332b8..1912a34 100644 --- a/src/pages/GitRank.jsx +++ b/src/pages/GitRank.jsx @@ -242,7 +242,7 @@ export const GitRank = () => { try { const eventsRes = await axios.get( - `https://api.github.com/users/${userData.githubUsername}/events`, + `https://api.github.com/users/${encodeURIComponent(userData.githubUsername)}/events`, { headers } ); setEvents(eventsRes.data || []); @@ -267,7 +267,7 @@ export const GitRank = () => { try { const reposRes = await axios.get( - `https://api.github.com/users/${userData.githubUsername}/repos?per_page=100&type=owner`, + `https://api.github.com/users/${encodeURIComponent(userData.githubUsername)}/repos?per_page=100&type=owner`, { headers } ); setRepos(reposRes.data || []);