From 05e14894acfabcb8c6f53ea858b0d80f915cbf09 Mon Sep 17 00:00:00 2001 From: Derek Holloway Date: Thu, 15 May 2025 21:01:38 -0700 Subject: [PATCH] Notify user of action happening on button press --- ToDo.txt | 6 ------ .../Pages/Account/ActivityPages/ForgotPassword.razor | 2 +- .../Pages/Account/ActivityPages/ResetPassword.razor | 12 ++++++++++-- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/ToDo.txt b/ToDo.txt index 93de4f0..3d24646 100755 --- a/ToDo.txt +++ b/ToDo.txt @@ -14,12 +14,6 @@ ProjectMistData.cs account/resetpassword make the account your resetting password for visible in ui - Passwords aren't obscured - After sucess and 3 seconds pass, change location to login frame - -ForgotPassword - No notice something is happening when button pressed - When the email is sent and waiting on timeout the error is : something went wrong and it should be cannot send email request that quickly ForgotPassword Email / Resetpassword Email Needs styles that match the theme of the website \ No newline at end of file diff --git a/src/MistoxWebsite.Client/Pages/Account/ActivityPages/ForgotPassword.razor b/src/MistoxWebsite.Client/Pages/Account/ActivityPages/ForgotPassword.razor index 10c3714..fefc28c 100755 --- a/src/MistoxWebsite.Client/Pages/Account/ActivityPages/ForgotPassword.razor +++ b/src/MistoxWebsite.Client/Pages/Account/ActivityPages/ForgotPassword.razor @@ -34,7 +34,7 @@ } public async Task TrySendCode() { - + Result = "Waiting on response from server"; HttpResponseMessage TestLogin = await Http.PostAsJsonAsync("api/account/sendresetpassword", new Account(){ Email = Email }); Result = await TestLogin.Content.ReadAsStringAsync(); diff --git a/src/MistoxWebsite.Client/Pages/Account/ActivityPages/ResetPassword.razor b/src/MistoxWebsite.Client/Pages/Account/ActivityPages/ResetPassword.razor index 5fb2d27..80beacd 100755 --- a/src/MistoxWebsite.Client/Pages/Account/ActivityPages/ResetPassword.razor +++ b/src/MistoxWebsite.Client/Pages/Account/ActivityPages/ResetPassword.razor @@ -4,6 +4,7 @@

Reset Password

+ User: @UserName
@@ -48,10 +49,17 @@ } protected async Task TryChange() { - + Result = "Waiting on response from server"; HttpResponseMessage TestLogin = await Http.PostAsJsonAsync("api/account/resetpassword", new Account(){ UserName = UserName, PasswordHash = NewPassword, Error = ResetPwd }); string result = await TestLogin.Content.ReadAsStringAsync(); - Result = result == "true" ? "Password changed successfully" : "Something is wrong"; + bool success = result == "true" ? true : false; + if (success){ + Result = "Password changed successfully"; + await Task.Delay(2000); + Nav.NavigateTo("/", true); + }else{ + Result = "Something is wrong"; + } } }