From c5154b2203342280a0cf75bb5f25311e6112400e Mon Sep 17 00:00:00 2001
From: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com>
Date: Tue, 22 Oct 2024 12:41:44 +0300
Subject: frontend: update profile after upload run

---
 frontend/src/App.tsx | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

(limited to 'frontend/src/App.tsx')

diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx
index d1d501d..6953de9 100644
--- a/frontend/src/App.tsx
+++ b/frontend/src/App.tsx
@@ -81,7 +81,6 @@ const App: React.FC = () => {
 
   return (
     <>
-      <UploadRunDialog token={token} open={uploadRunDialog} onClose={() => setUploadRunDialog(false)} games={games} />
       <Sidebar setToken={setToken} profile={profile} setProfile={setProfile} onUploadRun={() => setUploadRunDialog(true)} />
       <Routes>
         <Route path="/" element={<Homepage />} />
@@ -95,6 +94,12 @@ const App: React.FC = () => {
         <Route path='/rankings' element={<Rankings />}></Route>
         <Route path="*" element={"404"} />
       </Routes>
+      <UploadRunDialog token={token} open={uploadRunDialog} onClose={(updateProfile) => {
+        setUploadRunDialog(false);
+        if (token) {
+          _set_profile(get_user_id_from_token(token));
+        }
+      }} games={games} />
     </>
   );
 };
-- 
cgit v1.2.3

