From 747107e43d1baf9a57f8f28028f9f2dfcc746f9b Mon Sep 17 00:00:00 2001 From: Mladen Macanovic Date: Tue, 24 Nov 2020 10:52:53 +0100 Subject: [PATCH] Fixed breaking change on SnackbarStack --- .../Components/UiNotificationAlert.razor | 2 +- .../Components/UiNotificationAlert.razor.cs | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/framework/src/Volo.Abp.BlazoriseUI/Components/UiNotificationAlert.razor b/framework/src/Volo.Abp.BlazoriseUI/Components/UiNotificationAlert.razor index 8edd037e15..a1a60b2c9c 100644 --- a/framework/src/Volo.Abp.BlazoriseUI/Components/UiNotificationAlert.razor +++ b/framework/src/Volo.Abp.BlazoriseUI/Components/UiNotificationAlert.razor @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/framework/src/Volo.Abp.BlazoriseUI/Components/UiNotificationAlert.razor.cs b/framework/src/Volo.Abp.BlazoriseUI/Components/UiNotificationAlert.razor.cs index 7413b59009..0b527d6de2 100644 --- a/framework/src/Volo.Abp.BlazoriseUI/Components/UiNotificationAlert.razor.cs +++ b/framework/src/Volo.Abp.BlazoriseUI/Components/UiNotificationAlert.razor.cs @@ -1,5 +1,6 @@ using System; using System.Threading.Tasks; +using Blazorise; using Blazorise.Snackbar; using Microsoft.AspNetCore.Components; using Microsoft.Extensions.Localization; @@ -47,7 +48,7 @@ namespace Volo.Abp.BlazoriseUI.Components UiNotificationService.NotificationReceived += OnNotificationReceived; } - protected virtual void OnNotificationReceived(object sender, UiNotificationEventArgs e) + protected virtual async void OnNotificationReceived(object sender, UiNotificationEventArgs e) { NotificationType = e.NotificationType; Message = e.Message; @@ -56,7 +57,11 @@ namespace Volo.Abp.BlazoriseUI.Components var okButtonText = Options?.OkButtonText?.Localize(StringLocalizerFactory); - SnackbarStack.Push(Message, GetSnackbarColor( e.NotificationType ), okButtonText); + await SnackbarStack.PushAsync(Message, Title, GetSnackbarColor( e.NotificationType ), (options) => + { + options.CloseButtonIcon = IconName.Times; + options.ActionButtonText = okButtonText; + }); } public virtual void Dispose()