Hi there,
I am using NotificationService.notify twice in my app, and each time the notification shows up twice. However, when debugging it is called only once? What could be the issue?
This is basically my code:
private async Task ShareViaEmail()
{
try
{
var emailRequest = new EmailRequest
{
ToEmail = "...",
};
var uri = NavigationManager.ToAbsoluteUri($"api/upload/send-email");
var response = await Http.PostAsJsonAsync(uri, emailRequest);
response.EnsureSuccessStatusCode();
AppInsights.TrackEvent(new EventTelemetry() { Name = "ShareViaEmail" });
NotificationService.Notify(new NotificationMessage
{
Severity = NotificationSeverity.Success,
Summary = "Email Sent",
Detail = $"Email sent successfully to {emailRequest.ToEmail}. In some cases, you need to verify your spam folder.",
Duration = 10000
});
}
catch (Exception ex)
{
Console.WriteLine($"Error sharing via email: {ex.Message}");
}