From d67a42a30aa7856f465dd9b689fd30d673042fe7 Mon Sep 17 00:00:00 2001 From: Kukks Date: Thu, 21 Mar 2024 16:11:26 +0100 Subject: [PATCH] fix bring and breez --- .../Views/Shared/Breez/BreezNodeInfo.cshtml | 10 +++++----- Plugins/BTCPayServer.Plugins.Bringin/BringinService.cs | 4 +++- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Plugins/BTCPayServer.Plugins.Breez/Views/Shared/Breez/BreezNodeInfo.cshtml b/Plugins/BTCPayServer.Plugins.Breez/Views/Shared/Breez/BreezNodeInfo.cshtml index 48a676d..e7d2f8b 100644 --- a/Plugins/BTCPayServer.Plugins.Breez/Views/Shared/Breez/BreezNodeInfo.cshtml +++ b/Plugins/BTCPayServer.Plugins.Breez/Views/Shared/Breez/BreezNodeInfo.cshtml @@ -58,7 +58,7 @@
-

@LightMoney.MilliSatoshis(nodeState.onchainBalanceMsat)

+

@LightMoney.MilliSatoshis(nodeState.onchainBalanceMsat).ToUnit(LightMoneyUnit.BTC)

BTC
@@ -79,7 +79,7 @@
-

@LightMoney.MilliSatoshis(nodeState.channelsBalanceMsat)

+

@LightMoney.MilliSatoshis(nodeState.channelsBalanceMsat).ToUnit(LightMoneyUnit.BTC)

BTC
@@ -89,15 +89,15 @@
Lightning insight
-

@LightMoney.MilliSatoshis(nodeState.maxReceivableMsat)

+

@LightMoney.MilliSatoshis(nodeState.maxReceivableMsat).ToUnit(LightMoneyUnit.BTC)

BTC receivable
-

@LightMoney.MilliSatoshis(nodeState.inboundLiquidityMsats)

+

@LightMoney.MilliSatoshis(nodeState.inboundLiquidityMsats).ToUnit(LightMoneyUnit.BTC)

BTC inbound liquidity
-

@LightMoney.MilliSatoshis(nodeState.maxPayableMsat)

+

@LightMoney.MilliSatoshis(nodeState.maxPayableMsat).ToUnit(LightMoneyUnit.BTC)

BTC spendable
diff --git a/Plugins/BTCPayServer.Plugins.Bringin/BringinService.cs b/Plugins/BTCPayServer.Plugins.Bringin/BringinService.cs index 34478c4..f9b35c4 100644 --- a/Plugins/BTCPayServer.Plugins.Bringin/BringinService.cs +++ b/Plugins/BTCPayServer.Plugins.Bringin/BringinService.cs @@ -33,7 +33,9 @@ public static class StringExtensions public static string ToHumanReadable(this string str) { - return string.Join(' ', str.Split('_', '-').Select(part => + if(string.IsNullOrEmpty(str)) + return string.Empty; + return string.Join(' ', str.Split('_', '-').Select(part => CultureInfo.CurrentCulture.TextInfo.ToTitleCase(part.ToLower(CultureInfo.CurrentCulture)))); } }