From 4d842995f4067058b21729aab6139cd388c36353 Mon Sep 17 00:00:00 2001
From: Wolfboy248 <georgejvindkarlsen@gmail.com>
Date: Tue, 29 Oct 2024 11:45:00 +0100
Subject: refactor: loader dialog, uploadrundialog update, touchups

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

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

diff --git a/frontend/src/pages/Profile.tsx b/frontend/src/pages/Profile.tsx
index 3dba3ae..3f26bf8 100644
--- a/frontend/src/pages/Profile.tsx
+++ b/frontend/src/pages/Profile.tsx
@@ -10,6 +10,7 @@ import "../css/Profile.css";
 import { API } from '../api/Api';
 import useConfirm from '../hooks/UseConfirm';
 import useMessage from '../hooks/UseMessage';
+import useMessageLoad from "../hooks/UseMessageLoad";
 
 interface ProfileProps {
   profile?: UserProfile;
@@ -21,6 +22,7 @@ interface ProfileProps {
 const Profile: React.FC<ProfileProps> = ({ profile, token, gameData, onDeleteRecord }) => {
   const { confirm, ConfirmDialogComponent } = useConfirm();
   const { message, MessageDialogComponent } = useMessage();
+  const { messageLoad, messageLoadClose, MessageDialogLoadComponent } = useMessageLoad();
   const [navState, setNavState] = React.useState(0);
   const [pageNumber, setPageNumber] = React.useState(1);
   const [pageMax, setPageMax] = React.useState(0);
@@ -69,7 +71,10 @@ const Profile: React.FC<ProfileProps> = ({ profile, token, gameData, onDeleteRec
       return;
     }
 
+	messageLoad("Deleting...");
+
     const api_success = await API.delete_map_record(token!, map_id, record_id);
+	messageLoadClose();
     if (api_success) {
       await message("Delete Record", "Successfully deleted record.");
       onDeleteRecord();
@@ -105,6 +110,7 @@ const Profile: React.FC<ProfileProps> = ({ profile, token, gameData, onDeleteRec
   return (
   	<div>
 	{MessageDialogComponent}
+	{MessageDialogLoadComponent}
     {ConfirmDialogComponent}
 
     <main>      
-- 
cgit v1.2.3

