Fix toasts (#13)

This commit is contained in:
Daniel J. Summers 2021-03-16 11:34:58 -04:00
parent d6f4628e1c
commit 9e9b519c25
3 changed files with 23 additions and 10 deletions

View File

@ -25,9 +25,19 @@
</div>
</div>
</div>
<BlazoredToasts Position="ToastPosition.BottomRight"
ShowProgressBar="true" />
@if (InitToasts)
{
<BlazoredToasts Position="ToastPosition.BottomRight"
ShowProgressBar="true" />
}
@code {
async void PlayJobs() => await js.InvokeVoidAsync("Audio.play", "pelosijobs");
bool InitToasts = false;
async void PlayJobs() => await js.InvokeVoidAsync("Audio.play", "pelosijobs");
protected override void OnAfterRender(bool firstRender)
{
base.OnAfterRender(firstRender);
if (!InitToasts) InitToasts = true;
}
}

View File

@ -6,13 +6,14 @@
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<title>Jobs, Jobs, Jobs</title>
<base href="/" />
<link href="css/bootstrap/bootstrap.min.css" rel="stylesheet" />
<link href="css/app.css" rel="stylesheet" />
<link href="JobsJobsJobs.Client.styles.css" rel="stylesheet" />
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<title>Jobs, Jobs, Jobs</title>
<base href="/" />
<link href="css/bootstrap/bootstrap.min.css" rel="stylesheet" />
<link href="css/app.css" rel="stylesheet" />
<link href="JobsJobsJobs.Client.styles.css" rel="stylesheet" />
<link href="_content/Blazored.Toast/blazored-toast.min.css" rel="stylesheet">
</head>
<body>

View File

@ -1,3 +1,4 @@
using Blazored.Toast;
using JobsJobsJobs.Server.Data;
using Microsoft.AspNetCore.Authentication.JwtBearer;
using Microsoft.AspNetCore.Builder;
@ -43,6 +44,7 @@ namespace JobsJobsJobs.Server
services.AddRazorPages()
.AddJsonOptions(options =>
options.JsonSerializerOptions.ConfigureForNodaTime(DateTimeZoneProviders.Tzdb));
services.AddBlazoredToast();
services.AddAuthentication(options =>
{
options.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme;