From 8052754a4bcc3d07208d11aad764d2bb3492166d Mon Sep 17 00:00:00 2001
From: Pinapelz <yukais@pinapelz.com>
Date: Wed, 5 Nov 2025 15:52:09 -0800
Subject: add profile page to navbar

---
 frontend/src/pages/Profile.tsx | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

(limited to 'frontend/src/pages/Profile.tsx')

diff --git a/frontend/src/pages/Profile.tsx b/frontend/src/pages/Profile.tsx
index 83aa701..8a78fcf 100644
--- a/frontend/src/pages/Profile.tsx
+++ b/frontend/src/pages/Profile.tsx
@@ -30,7 +30,7 @@ interface UserData {
 
 const Profile = () => {
   const { user, isLoading, logout } = useAuth();
-  const targetUser =
+  let targetUser =
     new URLSearchParams(window.location.search).get("userId") || ""; // looking at profile of this user
   const navigate = useNavigate();
   const [fetchingHeatmapData, setFetchingHeatmapData] = useState(true);
@@ -101,14 +101,15 @@ const Profile = () => {
     }
   }, [targetUser]);
 
-  if (!targetUser) {
-    navigate("/");
-  }
-
   if (!user) {
     return <SessionExpiredPopup />;
   }
 
+  if (!targetUser) {
+    targetUser = user.id.toString();
+  }
+
+
   if (isLoading || fetchingHeatmapData || fetchingUserData) {
     return <LoadingDisplay message="Loading Profile Page..." />;
   }
@@ -129,7 +130,7 @@ const Profile = () => {
 
   return (
     <div className="min-h-screen bg-slate-950">
-      <NavBar user={user} handleLogout={handleLogout} currentPage="" />
+      <NavBar user={user} handleLogout={handleLogout} currentPage="profile" />
 
       {/* Main Content */}
       <div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-4 sm:py-8">
-- 
cgit v1.2.3

