[frontend] Code cleanup

This commit is contained in:
Lilian 2024-11-26 02:06:29 +01:00
parent 729ae593ad
commit 77e11ec400
No known key found for this signature in database

View file

@ -52,7 +52,6 @@
private string? Username { get; set; } private string? Username { get; set; }
private string? Password { get; set; } private string? Password { get; set; }
private string? Invite { get; set; } private string? Invite { get; set; }
private bool Loading { get; set; }
private bool Error { get; set; } private bool Error { get; set; }
private Registrations RegistrationAvailability { get; set; } private Registrations RegistrationAvailability { get; set; }
private State State { get; set; } = State.Loading; private State State { get; set; } = State.Loading;
@ -62,7 +61,6 @@
private async Task Submit() private async Task Submit()
{ {
Loading = true;
LoginButton.State = StateButton.StateEnum.Loading; LoginButton.State = StateButton.StateEnum.Loading;
StateHasChanged(); StateHasChanged();
if (Username is null || Password is null) if (Username is null || Password is null)
@ -70,7 +68,6 @@
Error = true; Error = true;
LoginButton.State = StateButton.StateEnum.Failed; LoginButton.State = StateButton.StateEnum.Failed;
RegistrationError = "Please fill out all fields"; RegistrationError = "Please fill out all fields";
Loading = false;
return; return;
} }
@ -100,13 +97,11 @@
Navigation.NavigateTo("/"); Navigation.NavigateTo("/");
} }
Loading = false;
} }
catch (ApiException e) catch (ApiException e)
{ {
RegistrationError = e.Response.Message; RegistrationError = e.Response.Message;
Error = true; Error = true;
Loading = false;
LoginButton.State = StateButton.StateEnum.Failed; LoginButton.State = StateButton.StateEnum.Failed;
StateHasChanged(); StateHasChanged();
} }