diff --git a/BTCPayServer/Views/UIInvoice/ListInvoices.cshtml b/BTCPayServer/Views/UIInvoice/ListInvoices.cshtml index 88c122d2b5..218291641e 100644 --- a/BTCPayServer/Views/UIInvoice/ListInvoices.cshtml +++ b/BTCPayServer/Views/UIInvoice/ListInvoices.cshtml @@ -5,12 +5,16 @@ @model InvoicesModel @{ ViewData.SetActivePage(InvoiceNavPages.Index, "Invoices"); + + var hasStatusFilter = HasArrayFilter("status") || HasArrayFilter("exceptionstatus") || HasBooleanFilter("includearchived") || HasBooleanFilter("unusual"); + var hasDateFilter = HasArrayFilter("startdate") || HasArrayFilter("enddate"); + var hasAppFilter = Model.Apps.Any(app => HasArrayFilter("orderid", app.AppOrderId)); } @functions { - private bool HasArrayFilter(string type, string key) => - Model.Search.ContainsFilter(type) && Model.Search.GetFilterArray(type).Contains(key); + private bool HasArrayFilter(string type, string key = null) => + Model.Search.ContainsFilter(type) && (key is null || Model.Search.GetFilterArray(type).Contains(key)); private bool HasBooleanFilter(string key) => Model.Search.ContainsFilter(key) && Model.Search.GetFilterBool(key) is true; @@ -233,45 +237,45 @@