mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2024-11-19 01:43:50 +01:00
Do not show cheatmode in release, fix warnigns
This commit is contained in:
parent
05b01a13c8
commit
4bffe117a9
@ -53,7 +53,7 @@ namespace BTCPayServer.Controllers.Greenfield
|
||||
|
||||
private static LightningAutomatedPayoutSettings ToModel(PayoutProcessorData data)
|
||||
{
|
||||
var blob = data.HasTypedBlob<LightningAutomatedPayoutBlob>().GetBlob();
|
||||
var blob = data.HasTypedBlob<LightningAutomatedPayoutBlob>().GetBlob() ?? new LightningAutomatedPayoutBlob();
|
||||
return new LightningAutomatedPayoutSettings()
|
||||
{
|
||||
PaymentMethod = data.PaymentMethod,
|
||||
|
@ -106,13 +106,13 @@ public class OnChainWalletReportProvider : ReportProvider
|
||||
}
|
||||
var objects = await WalletRepository.GetWalletObjects(new GetWalletObjectsQuery()
|
||||
{
|
||||
Ids = queryContext.Data.Select(d => (string)d[2]).ToArray(),
|
||||
Ids = queryContext.Data.Select(d => (string)d[2]!).ToArray(),
|
||||
WalletId = walletId,
|
||||
Type = "tx"
|
||||
});
|
||||
foreach (var row in queryContext.Data)
|
||||
{
|
||||
if (!objects.TryGetValue(new WalletObjectId(walletId, "tx", (string)row[2]), out var txObject))
|
||||
if (!objects.TryGetValue(new WalletObjectId(walletId, "tx", (string)row[2]!), out var txObject))
|
||||
continue;
|
||||
var invoiceId = txObject.GetLinks().Where(t => t.type == "invoice").Select(t => t.id).FirstOrDefault();
|
||||
row[3] = invoiceId;
|
||||
|
@ -1,3 +1,4 @@
|
||||
#nullable enable
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
@ -17,18 +18,20 @@ namespace BTCPayServer.Services.Reporting
|
||||
public DateTimeOffset To { get; }
|
||||
public ViewDefinition? ViewDefinition { get; set; }
|
||||
|
||||
public IList<object> AddData()
|
||||
public IList<object?> AddData()
|
||||
{
|
||||
var l = CreateData();
|
||||
Data.Add(l);
|
||||
return l;
|
||||
}
|
||||
|
||||
public IList<object> CreateData()
|
||||
public IList<object?> CreateData()
|
||||
{
|
||||
return new List<object>(ViewDefinition.Fields.Count);
|
||||
if (ViewDefinition is null)
|
||||
throw new InvalidOperationException("You need to initialize ViewDefinition first");
|
||||
return new List<object?>(ViewDefinition.Fields.Count);
|
||||
}
|
||||
|
||||
public IList<IList<object>> Data { get; set; } = new List<IList<object>>();
|
||||
public IList<IList<object?>> Data { get; set; } = new List<IList<object?>>();
|
||||
}
|
||||
}
|
||||
|
@ -1,26 +1,20 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Razor.TagHelpers;
|
||||
using System.Xml.Linq;
|
||||
using BTCPayServer.Configuration;
|
||||
|
||||
namespace BTCPayServer.TagHelpers;
|
||||
|
||||
|
||||
[HtmlTargetElement(Attributes = "[cheat-mode]")]
|
||||
public class CheatModeTagHelper
|
||||
[HtmlTargetElement(Attributes = "cheat-mode")]
|
||||
public class CheatModeTagHelper : TagHelper
|
||||
{
|
||||
public CheatModeTagHelper(BTCPayServerOptions env)
|
||||
{
|
||||
Env = env;
|
||||
}
|
||||
|
||||
public BTCPayServerOptions Env { get; }
|
||||
BTCPayServerOptions Env { get; }
|
||||
public bool CheatMode { get; set; }
|
||||
public void Process(TagHelperContext context, TagHelperOutput output)
|
||||
public override void Process(TagHelperContext context, TagHelperOutput output)
|
||||
{
|
||||
if (Env.CheatMode != CheatMode)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user