diff --git a/Atomex.Client.Desktop.csproj b/Atomex.Client.Desktop.csproj index d6f0b8ed..f5d53513 100644 --- a/Atomex.Client.Desktop.csproj +++ b/Atomex.Client.Desktop.csproj @@ -6,8 +6,8 @@ true Resources/Images/atomex_logo_256x256_ico.ico - 1.2.62 - 1.2.62 + 1.2.63 + 1.2.63 diff --git a/ViewModels/CurrencyViewModels/TezosTokenViewModel.cs b/ViewModels/CurrencyViewModels/TezosTokenViewModel.cs index bbd6122e..87d460db 100644 --- a/ViewModels/CurrencyViewModels/TezosTokenViewModel.cs +++ b/ViewModels/CurrencyViewModels/TezosTokenViewModel.cs @@ -74,7 +74,7 @@ public TezosTokenViewModel() .WhereNotNull() .Where(_ => AtomexApp != null) .Skip(1) - .SubscribeInMainThread(_ => UpdateQuotesInBaseCurrency(AtomexApp!.QuotesProvider)); + .SubscribeInMainThread(_ => UpdateQuotesInBaseCurrency(AtomexApp.QuotesProvider)); SendCommand.Merge(ReceiveCommand) .SubscribeInMainThread(_ => IsPopupOpened = false); diff --git a/ViewModels/CurrencyViewModels/TezosTokenViewModelCreator.cs b/ViewModels/CurrencyViewModels/TezosTokenViewModelCreator.cs index 2f14913c..967d355a 100644 --- a/ViewModels/CurrencyViewModels/TezosTokenViewModelCreator.cs +++ b/ViewModels/CurrencyViewModels/TezosTokenViewModelCreator.cs @@ -41,8 +41,21 @@ public static async Task> CreateOrGet( { if (Instances.TryGetValue((contract.Address, tokenGroup.Key), out var cachedTokenViewModel)) { - resultTokens.Add(cachedTokenViewModel); - continue; + var dbTokenBalance = tokenGroup.First().TokenBalance; + + // return cached if metadata don't changed + if (dbTokenBalance?.ArtifactUri == cachedTokenViewModel.TokenBalance.ArtifactUri && + dbTokenBalance?.DisplayUri == cachedTokenViewModel.TokenBalance.DisplayUri && + dbTokenBalance?.ThumbnailUri == cachedTokenViewModel.TokenBalance.ThumbnailUri && + dbTokenBalance?.Name == cachedTokenViewModel.TokenBalance.Name && + dbTokenBalance?.Description == cachedTokenViewModel.TokenBalance.Description) + { + resultTokens.Add(cachedTokenViewModel); + continue; + } + + cachedTokenViewModel.Dispose(); + Instances.TryRemove((contract.Address, tokenGroup.Key), out _); } var tokenBalance = tokenGroup diff --git a/atomex.client.core b/atomex.client.core index 1d4647a9..2b8ba993 160000 --- a/atomex.client.core +++ b/atomex.client.core @@ -1 +1 @@ -Subproject commit 1d4647a9fd2b8f3784845835914edc7fc58e00a9 +Subproject commit 2b8ba9937ab4987c130eca167adf0891ec8e4d2e