From 419ab8e0b1c0cda55ffa7d08f32ffccbe0311b69 Mon Sep 17 00:00:00 2001 From: Kukks Date: Fri, 11 Jan 2019 10:52:21 +0100 Subject: [PATCH 01/40] add loader and fix perk badge zindex --- BTCPayServer/Crowdfund/CrowdfundHub.cs | 35 ++++++++++++------- .../AppsPublic/Crowdfund/VueCrowdfund.cshtml | 26 +++++++++++--- BTCPayServer/wwwroot/crowdfund/app.js | 30 ++++++++++++---- .../wwwroot/crowdfund/styles/main.css | 1 + 4 files changed, 69 insertions(+), 23 deletions(-) diff --git a/BTCPayServer/Crowdfund/CrowdfundHub.cs b/BTCPayServer/Crowdfund/CrowdfundHub.cs index a2e00ebec..a030ed361 100644 --- a/BTCPayServer/Crowdfund/CrowdfundHub.cs +++ b/BTCPayServer/Crowdfund/CrowdfundHub.cs @@ -1,3 +1,4 @@ +using System; using System.Threading.Tasks; using BTCPayServer.Controllers; using BTCPayServer.Models.AppViewModels; @@ -35,20 +36,30 @@ namespace BTCPayServer.Hubs { model.RedirectToCheckout = false; _AppsPublicController.ControllerContext.HttpContext = Context.GetHttpContext(); - var result = await _AppsPublicController.ContributeToCrowdfund(Context.Items["app"].ToString(), model); - switch (result) + try { - case OkObjectResult okObjectResult: - await Clients.Caller.SendCoreAsync(InvoiceCreated, new[] {okObjectResult.Value.ToString()}); - break; - case ObjectResult objectResult: - await Clients.Caller.SendCoreAsync(InvoiceError, new[] {objectResult.Value}); - break; - default: - await Clients.Caller.SendCoreAsync(InvoiceError, System.Array.Empty()); - break; + + var result = + await _AppsPublicController.ContributeToCrowdfund(Context.Items["app"].ToString(), model); + switch (result) + { + case OkObjectResult okObjectResult: + await Clients.Caller.SendCoreAsync(InvoiceCreated, new[] {okObjectResult.Value.ToString()}); + break; + case ObjectResult objectResult: + await Clients.Caller.SendCoreAsync(InvoiceError, new[] {objectResult.Value}); + break; + default: + await Clients.Caller.SendCoreAsync(InvoiceError, System.Array.Empty()); + break; + } } - + catch (Exception) + { + await Clients.Caller.SendCoreAsync(InvoiceError, System.Array.Empty()); + + } + } } diff --git a/BTCPayServer/Views/AppsPublic/Crowdfund/VueCrowdfund.cshtml b/BTCPayServer/Views/AppsPublic/Crowdfund/VueCrowdfund.cshtml index 38d206846..1d21839a2 100644 --- a/BTCPayServer/Views/AppsPublic/Crowdfund/VueCrowdfund.cshtml +++ b/BTCPayServer/Views/AppsPublic/Crowdfund/VueCrowdfund.cshtml @@ -4,7 +4,7 @@

- {{srvModel.title}} + {{srvModel.title}} {{loading}} Starts {{startDateRelativeTime}} @@ -157,6 +157,7 @@ @@ -178,6 +179,7 @@

- @@ -220,10 +222,19 @@