mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2026-01-10 01:24:22 +01:00
add reset every x amount of time feature
This commit is contained in:
@@ -37,6 +37,8 @@ namespace BTCPayServer.Controllers
|
||||
public string DisqusShortname { get; set; }
|
||||
public bool AnimationsEnabled { get; set; }
|
||||
public bool UseInvoiceAmount { get; set; }
|
||||
public int ResetEveryAmount { get; set; }
|
||||
public CrowdfundResetEvery ResetEvery { get; set; }
|
||||
}
|
||||
|
||||
|
||||
@@ -68,7 +70,9 @@ namespace BTCPayServer.Controllers
|
||||
SoundsEnabled = settings.SoundsEnabled,
|
||||
DisqusShortname = settings.DisqusShortname,
|
||||
AnimationsEnabled = settings.AnimationsEnabled,
|
||||
UseInvoiceAmount = settings.UseInvoiceAmount
|
||||
UseInvoiceAmount = settings.UseInvoiceAmount,
|
||||
ResetEveryAmount = settings.ResetEveryAmount,
|
||||
ResetEvery = Enum.GetName(typeof(CrowdfundResetEvery), settings.ResetEvery),
|
||||
};
|
||||
return View(vm);
|
||||
}
|
||||
@@ -116,7 +120,8 @@ namespace BTCPayServer.Controllers
|
||||
SoundsEnabled = vm.SoundsEnabled,
|
||||
DisqusShortname = vm.DisqusShortname,
|
||||
AnimationsEnabled = vm.AnimationsEnabled,
|
||||
|
||||
ResetEveryAmount = vm.ResetEveryAmount,
|
||||
ResetEvery = Enum.Parse<CrowdfundResetEvery>(vm.ResetEvery),
|
||||
UseInvoiceAmount = vm.UseInvoiceAmount
|
||||
});
|
||||
await UpdateAppSettings(app);
|
||||
|
||||
@@ -122,12 +122,14 @@ namespace BTCPayServer.Controllers
|
||||
var info = await _CrowdfundHubStreamer.GetCrowdfundInfo(appId);
|
||||
|
||||
if(!isAdmin &&
|
||||
|
||||
((settings.StartDate.HasValue && DateTime.Now < settings.StartDate) ||
|
||||
(settings.EndDate.HasValue && DateTime.Now > settings.EndDate) ||
|
||||
(settings.EnforceTargetAmount && (info.Info.PendingProgressPercentage.GetValueOrDefault(0) + info.Info.ProgressPercentage.GetValueOrDefault(0)) >= 100)))
|
||||
(settings.EnforceTargetAmount &&
|
||||
(info.Info.PendingProgressPercentage.GetValueOrDefault(0) +
|
||||
info.Info.ProgressPercentage.GetValueOrDefault(0)) >= 100)))
|
||||
{
|
||||
return NotFound();
|
||||
|
||||
}
|
||||
|
||||
var store = await _AppsHelper.GetStore(app);
|
||||
|
||||
Reference in New Issue
Block a user