mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-02-20 13:34:37 +01:00
Add list count to user preferences cookie (#4637)
I think it's fair to assume that the user wants to set this as a preference and it fixes #4592.
This commit is contained in:
parent
87eef72289
commit
cc9c63c33e
3 changed files with 8 additions and 3 deletions
|
@ -50,11 +50,12 @@ namespace BTCPayServer
|
|||
{
|
||||
model.SearchTerm = section.SearchTerm;
|
||||
model.TimezoneOffset = section.TimezoneOffset ?? 0;
|
||||
model.Count = section.Count ?? BasePagingViewModel.CountDefault;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
prop.SetValue(prefCookie, new ListQueryDataHolder(model.SearchTerm, model.TimezoneOffset));
|
||||
prop.SetValue(prefCookie, new ListQueryDataHolder(model.SearchTerm, model.TimezoneOffset, model.Count));
|
||||
ctrl.Response.Cookies.Append(nameof(UserPrefsCookie), JsonConvert.SerializeObject(prefCookie));
|
||||
}
|
||||
|
||||
|
|
|
@ -14,13 +14,15 @@ namespace BTCPayServer
|
|||
{
|
||||
public ListQueryDataHolder() { }
|
||||
|
||||
public ListQueryDataHolder(string searchTerm, int? timezoneOffset)
|
||||
public ListQueryDataHolder(string searchTerm, int? timezoneOffset, int? count)
|
||||
{
|
||||
SearchTerm = searchTerm;
|
||||
TimezoneOffset = timezoneOffset;
|
||||
Count = count;
|
||||
}
|
||||
|
||||
public int? TimezoneOffset { get; set; }
|
||||
public string SearchTerm { get; set; }
|
||||
public int? Count { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,8 +5,10 @@ namespace BTCPayServer.Models
|
|||
{
|
||||
public abstract class BasePagingViewModel
|
||||
{
|
||||
public const int CountDefault = 50;
|
||||
|
||||
public int Skip { get; set; } = 0;
|
||||
public int Count { get; set; } = 50;
|
||||
public int Count { get; set; } = CountDefault;
|
||||
public int? Total { get; set; }
|
||||
[DisplayFormat(ConvertEmptyStringToNull = false)]
|
||||
public string SearchTerm { get; set; }
|
||||
|
|
Loading…
Add table
Reference in a new issue