Skip to content

Commit

Permalink
Close ATM-412, enable balance updating for XTZ and FA12, FA2 tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
matsakiv committed Mar 22, 2023
1 parent 00e8ea6 commit 71a1698
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 3 deletions.
21 changes: 21 additions & 0 deletions ViewModels/MyWalletsViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
using Atomex.Wallet;
using Atomex.Wallet.Abstract;
using Serilog;
using System.Threading.Tasks;

namespace Atomex.Client.Desktop.ViewModels
{
Expand Down Expand Up @@ -83,6 +84,26 @@ private void OnSelectWallet(WalletInfo info)
wallet: wallet,
localStorage: localStorage,
currenciesProvider: _app.CurrenciesProvider);
// update balances
_ = Task.Run(async () =>
{
var currencies = new string[] { "XTZ", "FA12", "FA2" };
try
{
foreach (var currency in currencies)
{
await new WalletScanner(account)
.UpdateBalanceAsync(currency, skipUsed: true)
.ConfigureAwait(false);
}
}
catch(Exception e)
{
Log.Error(e, "Error while update wallet balance on start");
}
});
},
goBack: () =>
{
Expand Down
2 changes: 1 addition & 1 deletion ViewModels/SendViewModels/EthereumSendViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ protected override void DesignerMode()
RecommendedMaxAmountWarningToolTip = "You have tokens that require ETH. Sending this will not leave enough ETH to send or exchange your tokens. We recommend to send no more than 0.073 ETH";
RecommendedMaxAmountWarningType = MessageType.Warning;

Stage = SendStage.Confirmation;
Stage = SendStage.Edit;
SendRecommendedAmountMenu = string.Format(Resources.SendRecommendedAmountMenu, 0.073, "ETH");
SendEnteredAmountMenu = string.Format(Resources.SendEnteredAmountMenu, 0.073, "ETH");

Expand Down
3 changes: 2 additions & 1 deletion Views/SendViews/EthereumSendView.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -417,9 +417,10 @@
Foreground="{DynamicResource SecondaryForegroundBrush}"
Content="Use default fee"/>

<!-- max gas price -->
<StackPanel Grid.Column="1"
Margin="0 7 0 0"
Orientation="Vertical">
<!-- max gas price -->
<StackPanel HorizontalAlignment="Right"
Orientation="Horizontal"
IsVisible="{Binding UseDefaultFee}">
Expand Down

0 comments on commit 71a1698

Please sign in to comment.