diff --git a/Oqtane.Client/Modules/Admin/UserProfile/Add.razor b/Oqtane.Client/Modules/Admin/UserProfile/Add.razor index c413ec91..b19bae1d 100644 --- a/Oqtane.Client/Modules/Admin/UserProfile/Add.razor +++ b/Oqtane.Client/Modules/Admin/UserProfile/Add.razor @@ -65,7 +65,8 @@ notification.ParentId = null; notification.CreatedOn = DateTime.UtcNow; notification.IsDelivered = false; - notification.DeliveredOn = null; + notification.DeliveredOn = null; + notification.SendOn = DateTime.UtcNow; notification = await NotificationService.AddNotificationAsync(notification); await logger.LogInformation("Notification Created {Notification}", notification); NavigationManager.NavigateTo(NavigateUrl()); diff --git a/Oqtane.Client/Modules/Admin/UserProfile/View.razor b/Oqtane.Client/Modules/Admin/UserProfile/View.razor index 2e48fcb1..32dde145 100644 --- a/Oqtane.Client/Modules/Admin/UserProfile/View.razor +++ b/Oqtane.Client/Modules/Admin/UserProfile/View.razor @@ -191,7 +191,8 @@ notification.ParentId = notificationid; notification.CreatedOn = DateTime.UtcNow; notification.IsDelivered = false; - notification.DeliveredOn = null; + notification.DeliveredOn = null; + notification.SendOn = DateTime.UtcNow; notification = await NotificationService.AddNotificationAsync(notification); await logger.LogInformation("Notification Created {Notification}", notification); NavigationManager.NavigateTo(NavigateUrl()); diff --git a/Oqtane.Server/Repository/NotificationRepository.cs b/Oqtane.Server/Repository/NotificationRepository.cs index 4e6550d2..45730d84 100644 --- a/Oqtane.Server/Repository/NotificationRepository.cs +++ b/Oqtane.Server/Repository/NotificationRepository.cs @@ -21,6 +21,7 @@ namespace Oqtane.Repository return _db.Notification .Where(item => item.SiteId == siteId) .Where(item => item.IsDelivered == false) + .Where(item => item.SendOn < System.DateTime.UtcNow) .ToList(); }