public async Task <IActionResult> ViewCrowdfund(string appId, string statusMessage) { var app = await _AppsHelper.GetApp(appId, AppType.Crowdfund, true); if (app == null) { return(NotFound()); } var settings = app.GetSettings <CrowdfundSettings>(); var isAdmin = await _AppsHelper.GetAppDataIfOwner(GetUserId(), appId, AppType.Crowdfund) != null; var hasEnoughSettingsToLoad = !string.IsNullOrEmpty(settings.TargetCurrency); if (!hasEnoughSettingsToLoad) { if (!isAdmin) { return(NotFound()); } return(NotFound("A Target Currency must be set for this app in order to be loadable.")); } if (settings.Enabled) { return(View(await _CrowdfundHubStreamer.GetCrowdfundInfo(appId))); } if (!isAdmin) { return(NotFound()); } return(View(await _CrowdfundHubStreamer.GetCrowdfundInfo(appId))); }
private Task <AppData> GetOwnedApp(string appId, AppType?type = null) { return(_AppsHelper.GetAppDataIfOwner(GetUserId(), appId, type)); }