mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-18 14:34:23 +01:00
Changing case for private methods
This commit is contained in:
@@ -35,7 +35,7 @@ namespace BTCPayServer.Controllers
|
||||
[HttpGet]
|
||||
public async Task<IActionResult> Index(int skip = 0, int count = 50, int timezoneOffset = 0)
|
||||
{
|
||||
if (!validUserClaim(out var userId))
|
||||
if (!ValidUserClaim(out var userId))
|
||||
return RedirectToAction("Index", "Home");
|
||||
|
||||
var model = new IndexViewModel()
|
||||
@@ -63,7 +63,7 @@ namespace BTCPayServer.Controllers
|
||||
[HttpPost]
|
||||
public async Task<IActionResult> FlipRead(string id)
|
||||
{
|
||||
if (validUserClaim(out var userId))
|
||||
if (ValidUserClaim(out var userId))
|
||||
{
|
||||
var notif = _db.Notifications.Single(a => a.Id == id && a.ApplicationUserId == userId);
|
||||
notif.Seen = !notif.Seen;
|
||||
@@ -78,7 +78,7 @@ namespace BTCPayServer.Controllers
|
||||
{
|
||||
if (selectedItems != null)
|
||||
{
|
||||
if (command == "delete" && validUserClaim(out var userId))
|
||||
if (command == "delete" && ValidUserClaim(out var userId))
|
||||
{
|
||||
var toRemove = _db.Notifications.Where(a => a.ApplicationUserId == userId && selectedItems.Contains(a.Id));
|
||||
_db.Notifications.RemoveRange(toRemove);
|
||||
@@ -91,7 +91,7 @@ namespace BTCPayServer.Controllers
|
||||
return RedirectToAction(nameof(Index));
|
||||
}
|
||||
|
||||
private bool validUserClaim(out string userId)
|
||||
private bool ValidUserClaim(out string userId)
|
||||
{
|
||||
userId = _userManager.GetUserId(User);
|
||||
return userId != null;
|
||||
|
||||
@@ -64,13 +64,13 @@ namespace BTCPayServer.HostedServices
|
||||
if (_cache.TryGetValue<NotificationSummaryViewModel>(userId, out var obj))
|
||||
return obj;
|
||||
|
||||
var resp = fetchNotificationsFromDb(userId);
|
||||
var resp = FetchNotificationsFromDb(userId);
|
||||
_cache.Set(userId, resp, new MemoryCacheEntryOptions().SetAbsoluteExpiration(TimeSpan.FromMilliseconds(_cacheExpiryMs)));
|
||||
|
||||
return resp;
|
||||
}
|
||||
|
||||
private NotificationSummaryViewModel fetchNotificationsFromDb(string userId)
|
||||
private NotificationSummaryViewModel FetchNotificationsFromDb(string userId)
|
||||
{
|
||||
var resp = new NotificationSummaryViewModel();
|
||||
using (var _db = _factory.CreateContext())
|
||||
@@ -90,7 +90,7 @@ namespace BTCPayServer.HostedServices
|
||||
.Select(a => a.ViewModel())
|
||||
.ToList();
|
||||
}
|
||||
catch (System.IO.InvalidDataException iex)
|
||||
catch (System.IO.InvalidDataException)
|
||||
{
|
||||
// invalid notifications that are not pkuzipable, burn them all
|
||||
var notif = _db.Notifications.Where(a => a.ApplicationUserId == userId);
|
||||
|
||||
Reference in New Issue
Block a user