From a2fc7daa9b65fcdf25b898923b98ca805b6144c3 Mon Sep 17 00:00:00 2001 From: Michiel Post Date: Wed, 17 Apr 2024 19:59:49 +0200 Subject: [PATCH] Bugfix and cleanup --- src/aoWebWallet/Pages/ActionPage.razor | 3 ++- src/aoWebWallet/Pages/ActionPage.razor.cs | 18 ++++++++++++------ src/aoWebWallet/Pages/MvvmComponentBase.cs | 8 +------- src/aoWebWallet/Services/GraphqlClient.cs | 2 -- src/aoWebWallet/ViewModels/MainViewModel.cs | 2 -- 5 files changed, 15 insertions(+), 18 deletions(-) diff --git a/src/aoWebWallet/Pages/ActionPage.razor b/src/aoWebWallet/Pages/ActionPage.razor index d24a4fa..7928bd4 100644 --- a/src/aoWebWallet/Pages/ActionPage.razor +++ b/src/aoWebWallet/Pages/ActionPage.razor @@ -13,10 +13,11 @@ TODO: Select a wallet, or create a new wallet + @if (BindingContext.WalletList.Data != null) { - if (BindingContext.WalletList.Data.Any()) + if (!BindingContext.WalletList.Data.Any()) { Add Wallet } diff --git a/src/aoWebWallet/Pages/ActionPage.razor.cs b/src/aoWebWallet/Pages/ActionPage.razor.cs index d108d71..340d22b 100644 --- a/src/aoWebWallet/Pages/ActionPage.razor.cs +++ b/src/aoWebWallet/Pages/ActionPage.razor.cs @@ -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) @@ -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(); - } + //} } } diff --git a/src/aoWebWallet/Pages/MvvmComponentBase.cs b/src/aoWebWallet/Pages/MvvmComponentBase.cs index 0687f07..a141a8d 100644 --- a/src/aoWebWallet/Pages/MvvmComponentBase.cs +++ b/src/aoWebWallet/Pages/MvvmComponentBase.cs @@ -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() diff --git a/src/aoWebWallet/Services/GraphqlClient.cs b/src/aoWebWallet/Services/GraphqlClient.cs index 7e9e41a..c8b6aa0 100644 --- a/src/aoWebWallet/Services/GraphqlClient.cs +++ b/src/aoWebWallet/Services/GraphqlClient.cs @@ -318,8 +318,6 @@ public async Task> GetAoProcessesForAddress(string address) var result = new List(); - Console.WriteLine("AOresult:" + (queryResult?.Data?.Transactions?.Edges.Count ?? 0).ToString()); - foreach (var edge in queryResult?.Data?.Transactions?.Edges ?? new()) { AoProcessInfo? processInfo = GetAoProcessInfo(edge); diff --git a/src/aoWebWallet/ViewModels/MainViewModel.cs b/src/aoWebWallet/ViewModels/MainViewModel.cs index 68374a9..1be2e4a 100644 --- a/src/aoWebWallet/ViewModels/MainViewModel.cs +++ b/src/aoWebWallet/ViewModels/MainViewModel.cs @@ -326,8 +326,6 @@ public async Task LoadWalletList(bool force = false) WalletList.Data = list; - - await LoadProcessesDataList(); } }