mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-18 22:44:29 +01:00
Remove Confirmed state in UI (#3090)
* 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>
This commit is contained in:
33
BTCPayServer/Extensions/UserExtensions.cs
Normal file
33
BTCPayServer/Extensions/UserExtensions.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
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; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user