Files
hamkadr/src/JobsMedical.Web/Pages/Download.cshtml.cs
T

21 lines
609 B
C#
Raw Normal View History

using JobsMedical.Web.Services.Scraping;
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace JobsMedical.Web.Pages;
public class DownloadModel : PageModel
{
private readonly SettingsService _settings;
public DownloadModel(SettingsService settings) => _settings = settings;
public string? VapidPublicKey { get; private set; }
public bool PushReady { get; private set; }
public async Task OnGetAsync()
{
var s = await _settings.GetAsync();
VapidPublicKey = s.VapidPublicKey;
PushReady = s.PushEnabled && !string.IsNullOrWhiteSpace(s.VapidPublicKey);
}
}