Improve UI of immature balance, show available balance in wallet list (#2732)

This commit is contained in:
Nicolas Dorier
2021-08-01 22:13:12 +09:00
committed by GitHub
parent 906c7eb7ec
commit 1b85ab8b54
4 changed files with 7 additions and 6 deletions

View File

@@ -27,7 +27,7 @@
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" /> <PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="NBitcoin" Version="6.0.4" /> <PackageReference Include="NBitcoin" Version="6.0.6" />
<PackageReference Include="BTCPayServer.Lightning.Common" Version="1.2.4" /> <PackageReference Include="BTCPayServer.Lightning.Common" Version="1.2.4" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" /> <PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
</ItemGroup> </ItemGroup>

View File

@@ -6,7 +6,7 @@
<FrameworkReference Include="Microsoft.AspNetCore.App" /> <FrameworkReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="3.6.0" /> <PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="3.6.0" />
<PackageReference Include="Microsoft.AspNet.WebApi.Client" Version="5.2.7" /> <PackageReference Include="Microsoft.AspNet.WebApi.Client" Version="5.2.7" />
<PackageReference Include="NBitcoin" Version="6.0.4" /> <PackageReference Include="NBitcoin" Version="6.0.6" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" /> <PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="DigitalRuby.ExchangeSharp" Version="0.6.3" /> <PackageReference Include="DigitalRuby.ExchangeSharp" Version="0.6.3" />
</ItemGroup> </ItemGroup>

View File

@@ -1063,7 +1063,8 @@ namespace BTCPayServer.Controllers
using CancellationTokenSource cts = new CancellationTokenSource(TimeSpan.FromSeconds(10)); using CancellationTokenSource cts = new CancellationTokenSource(TimeSpan.FromSeconds(10));
try try
{ {
return (await wallet.GetBalance(derivationStrategy, cts.Token)).Total.ShowMoney(wallet.Network); var b = await wallet.GetBalance(derivationStrategy, cts.Token);
return (b.Available ?? b.Total).ShowMoney(wallet.Network);
} }
catch catch
{ {

View File

@@ -1,4 +1,4 @@
@addTagHelper *, BundlerMinifier.TagHelpers @addTagHelper *, BundlerMinifier.TagHelpers
@using Microsoft.AspNetCore.Mvc.ModelBinding @using Microsoft.AspNetCore.Mvc.ModelBinding
@model WalletSendModel @model WalletSendModel
@{ @{
@@ -84,7 +84,7 @@
<button type="button" class="crypto-balance-link btn btn-link p-0 align-baseline">@Model.CurrentBalance</button> <span>@Model.CryptoCode</span>. <button type="button" class="crypto-balance-link btn btn-link p-0 align-baseline">@Model.CurrentBalance</button> <span>@Model.CryptoCode</span>.
@if (Model.ImmatureBalance > 0) @if (Model.ImmatureBalance > 0)
{ {
<span><br>Note: @Model.ImmatureBalance @Model.CryptoCode are still immature and require additional confirmations.</span> <span><br><span class="text-warning">⚠</span> @Model.ImmatureBalance @Model.CryptoCode are still immature and require additional confirmations.</span>
} }
</p> </p>
</div> </div>