btcpayserver/BTCPayServer/Views/Shared/LNURL/LightningAddressNav.cshtml
d11n e4f256d5cd
Lightning Address: Fix availability check and refactor option view (#4584)
As @petzsch rightfully assumed in #4578, the check took only the last available LN payment method into account, which in this case was LN on LTC. We now pass the crypto code as well and I refactored the checks as well as the option view.

Fixes #4578.
2023-02-02 09:42:41 +09:00

19 lines
799 B
Text

@using BTCPayServer.Views.Stores
@using BTCPayServer.Abstractions.Extensions
@inject BTCPayNetworkProvider BTCPayNetworkProvider
@{
const string cryptoCode = "BTC";
var store = Context.GetStoreData();
var isLightningEnabled = store.IsLightningEnabled(BTCPayNetworkProvider, cryptoCode);
var isLNUrlEnabled = store.IsLNUrlEnabled(BTCPayNetworkProvider, cryptoCode);
}
@if (isLightningEnabled && isLNUrlEnabled)
{
<li class="nav-item">
<a asp-area="" asp-controller="UILNURL" asp-action="EditLightningAddress" asp-route-storeId="@store.Id" class="nav-link @ViewData.IsActivePage("LightningAddress", nameof(StoreNavPages))" id="StoreNav-LightningAddress">
<vc:icon symbol="wallet-lightning"/>
<span>Lightning Address</span>
</a>
</li>
}