Skip to content

Commit

Permalink
Bugfix and cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
michielpost committed Apr 17, 2024
1 parent 252362c commit a2fc7da
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 18 deletions.
3 changes: 2 additions & 1 deletion src/aoWebWallet/Pages/ActionPage.razor
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@

<MudStack>
TODO: Select a wallet, or create a new wallet
<DataLoaderProgress DataLoader="BindingContext.TokenList.DataLoader" Title="tokens" />

@if (BindingContext.WalletList.Data != null)
{
if (BindingContext.WalletList.Data.Any())
if (!BindingContext.WalletList.Data.Any())
{
<MudButton aria-label="add wallet" Size="Size.Large" OnClick="OpenDialog">Add Wallet</MudButton>
}
Expand Down
18 changes: 12 additions & 6 deletions src/aoWebWallet/Pages/ActionPage.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ protected override void OnInitialized()
GetQueryStringValues();
WatchDataLoaderVM(BindingContext.TokenList);
WatchDataLoaderVM(BindingContext.WalletList);
WatchDataLoaderVM(BindingContext.BalanceDataList);

NavigationManager.LocationChanged += NavigationManager_LocationChanged;

base.OnInitialized();
}

protected override async Task OnAfterRenderAsync(bool firstRender)
Expand Down Expand Up @@ -99,18 +103,20 @@ void GetQueryStringValues()



public void Dispose()
public override void Dispose()
{
NavigationManager.LocationChanged -= NavigationManager_LocationChanged;

base.Dispose();
}

protected override async Task LoadDataAsync()
{
await BindingContext.LoadTokenList();
//protected override async Task LoadDataAsync()
//{
// await BindingContext.LoadTokenList();

await base.LoadDataAsync();
// await base.LoadDataAsync();

}
//}

}
}
8 changes: 1 addition & 7 deletions src/aoWebWallet/Pages/MvvmComponentBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,9 @@ internal async void BindingContext_PropertyChanged(object? sender, System.Compon
}
}

internal async void ObjWatch_PropertyChanged(object? sender, System.ComponentModel.PropertyChangedEventArgs e)
internal void ObjWatch_PropertyChanged(object? sender, System.ComponentModel.PropertyChangedEventArgs e)
{
this.StateHasChanged();
await ChartRenderAsync();
}

protected virtual Task ChartRenderAsync()
{
return Task.CompletedTask;
}

protected virtual Task LoadDataAsync()
Expand Down
2 changes: 0 additions & 2 deletions src/aoWebWallet/Services/GraphqlClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -318,8 +318,6 @@ public async Task<List<AoProcessInfo>> GetAoProcessesForAddress(string address)

var result = new List<AoProcessInfo>();

Console.WriteLine("AOresult:" + (queryResult?.Data?.Transactions?.Edges.Count ?? 0).ToString());

foreach (var edge in queryResult?.Data?.Transactions?.Edges ?? new())
{
AoProcessInfo? processInfo = GetAoProcessInfo(edge);
Expand Down
2 changes: 0 additions & 2 deletions src/aoWebWallet/ViewModels/MainViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -326,8 +326,6 @@ public async Task LoadWalletList(bool force = false)

WalletList.Data = list;



await LoadProcessesDataList();
}
}
Expand Down

0 comments on commit a2fc7da

Please sign in to comment.