Old Payout labels weren't displayed properly

This commit is contained in:
nicolas.dorier 2022-09-29 15:42:01 +09:00
parent 4bee8e9bfe
commit b7ea128132
No known key found for this signature in database
GPG key ID: 6618763EF09186FE

View file

@ -15,7 +15,7 @@ namespace BTCPayServer.Services.Labels
{
return this;
}
static void FixLegacy(JObject jObj, ReferenceLabel refLabel)
{
if (refLabel.Reference is null && jObj.ContainsKey("id"))
@ -29,6 +29,12 @@ namespace BTCPayServer.Services.Labels
var pullPaymentId = jObj["pullPaymentId"]?.Value<string>() ?? string.Empty;
payoutLabel.PullPaymentPayouts.Add(pullPaymentId, new List<string>() { jObj["id"].Value<string>() });
}
else if (jObj.ContainsKey("payoutId") && jObj.ContainsKey("pullPaymentId"))
{
var pullPaymentId = jObj["pullPaymentId"]?.Value<string>() ?? string.Empty;
var payoutId = jObj["payoutId"]?.Value<string>() ?? string.Empty;
payoutLabel.PullPaymentPayouts.Add(pullPaymentId, new List<string>() { payoutId });
}
FixLegacy(jObj, (Label)payoutLabel);
}
static void FixLegacy(JObject jObj, Label label)