mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-02-27 07:57:33 +01:00
* Remove Confirmed state in UI Closes #1789. * Add infobox & improve refund tooltip * Update BTCPayServer/Views/Invoice/ListInvoices.cshtml Add @dennisreimann suggestion Co-authored-by: d11n <mail@dennisreimann.de> * Add "don't show again" button Adds a "Don't Show Again" button to the infobox. Also a bugfix that was preventing the new status from showing in the invoice details page. * Add User blob and move invoice status notice to it Co-authored-by: d11n <mail@dennisreimann.de> Co-authored-by: Kukks <evilkukka@gmail.com>
33 lines
977 B
C#
33 lines
977 B
C#
using System.Linq;
|
|
using BTCPayServer.Data;
|
|
using BTCPayServer.Services.Invoices;
|
|
using Newtonsoft.Json.Linq;
|
|
|
|
namespace BTCPayServer
|
|
{
|
|
public static class UserExtensions
|
|
{
|
|
public static UserBlob GetBlob(this ApplicationUser user)
|
|
{
|
|
var result = user.Blob == null
|
|
? new UserBlob()
|
|
: JObject.Parse(ZipUtils.Unzip(user.Blob)).ToObject<UserBlob>();
|
|
return result;
|
|
}
|
|
public static bool SetBlob(this ApplicationUser user, UserBlob blob)
|
|
{
|
|
var newBytes = InvoiceRepository.ToBytes(blob);
|
|
if (user.Blob != null && newBytes.SequenceEqual(user.Blob))
|
|
{
|
|
return false;
|
|
}
|
|
user.Blob = newBytes;
|
|
return true;
|
|
}
|
|
}
|
|
|
|
public class UserBlob
|
|
{
|
|
public bool ShowInvoiceStatusChangeHint { get; set; }
|
|
}
|
|
}
|