Skip to content

Commit

Permalink
Disable generate wallet button after click
Browse files Browse the repository at this point in the history
  • Loading branch information
michielpost committed May 26, 2024
1 parent 1ce133f commit b6eb9de
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/aoWebWallet/Shared/AddGenerateWalletComponent.razor
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

<MudText DefaultFocus="DefaultFocus" Color="Color.Secondary">@Progress</MudText>
<div Class="d-w-100 d-flex justify-center mt-2">
<MudButton Class="text-transform-none" Color="Color.Primary" Variant="Variant.Filled" OnClick="Submit">
<MudButton Disabled="ButtonDisabled" Class="text-transform-none" Color="Color.Primary" Variant="Variant.Filled" OnClick="Submit">
Create aoWW Wallet
</MudButton>
</div>
Expand All @@ -23,6 +23,7 @@
@code {

bool Disabled { get; set; } = false;
bool ButtonDisabled { get; set; } = false;
DefaultFocus DefaultFocus { get; set; } = DefaultFocus.FirstChild;

[Parameter]
Expand All @@ -44,6 +45,10 @@

public async Task<bool> Submit()
{
if (ButtonDisabled)
return false;

ButtonDisabled = true;
var jwk = await ArweaveService.GenerateWallet();
var address = await ArweaveService.GetAddress(jwk);

Expand All @@ -62,6 +67,8 @@

Snackbar.Add($"Wallet added ({address})", Severity.Info);

ButtonDisabled = false;

if (MudDialog != null)
{
MudDialog.Close();
Expand Down

0 comments on commit b6eb9de

Please sign in to comment.