diff options
Diffstat (limited to 'src/Pages/Index.cshtml.cs')
| -rw-r--r-- | src/Pages/Index.cshtml.cs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/Pages/Index.cshtml.cs b/src/Pages/Index.cshtml.cs index 9305766..80b0ed0 100644 --- a/src/Pages/Index.cshtml.cs +++ b/src/Pages/Index.cshtml.cs @@ -16,15 +16,15 @@ public class IndexModel : PageModel public NewsSource Source { get; set; } public async Task<ActionResult> OnGet(string site) { - if (site.IsNullOrWhiteSpace()) { - return Redirect("/nrk"); - } - Source = site switch { "nrk" => await _grabber.GrabNrkAsync(), - _ => await _grabber.GrabNrkAsync() + _ => default }; + if (Source == default) { + return Redirect("/nrk"); + } + return Page(); } }
\ No newline at end of file |
