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/components/UploadRunDialog.tsx | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

(limited to 'frontend/src/components/UploadRunDialog.tsx')

diff --git a/frontend/src/components/UploadRunDialog.tsx b/frontend/src/components/UploadRunDialog.tsx
index a1bebd6..b39aab6 100644
--- a/frontend/src/components/UploadRunDialog.tsx
+++ b/frontend/src/components/UploadRunDialog.tsx
@@ -13,7 +13,7 @@ import useConfirm from '../hooks/UseConfirm';
 interface UploadRunDialogProps {
   token?: string;
   open: boolean;
-  onClose: () => void;
+  onClose: (updateProfile: boolean) => void;
   games: Game[];
 }
 
@@ -123,10 +123,9 @@ const UploadRunDialog: React.FC<UploadRunDialogProps> = ({ token, open, onClose,
         return;
       }
 
-      const response = await API.post_record(token, uploadRunContent);
+      const [ success, response ] = await API.post_record(token, uploadRunContent);
       await message("Upload Record", response);
-      // navigate(0);
-      onClose();
+      onClose(success);
     }
   };
 
@@ -193,7 +192,7 @@ const UploadRunDialog: React.FC<UploadRunDialogProps> = ({ token, open, onClose,
                       </div>
                       <div className='upload-run-buttons-container'>
                         <button onClick={_upload_run}>Submit</button>
-                        <button onClick={() => onClose()}>Cancel</button>
+                        <button onClick={() => onClose(false)}>Cancel</button>
                       </div>
                     </div>
                   </>
-- 
cgit v1.2.3

