Skip to content

Commit

Permalink
🐛 通知消息弹出不再重复弹出同样消息
Browse files Browse the repository at this point in the history
  • Loading branch information
rmbadmin committed Sep 23, 2024
1 parent 71f104b commit 6ceaeb0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/BD.WTTS.Client/Services/Mvvm/NoticeService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ public NoticeService()
{
Notices = new ObservableCollection<OfficialMessageItemDTO>();

_timer = new Timer(async _ =>
_timer = new Timer(_ =>
{
await GetNewsAsync();
GetNewsAsync().Wait();
}, null, TimeSpan.FromHours(2), TimeSpan.FromHours(2));

//NoticesSource = new(x => x.Id);
Expand Down Expand Up @@ -60,7 +60,6 @@ public void VerifyNotificationsHasRead()
if (item.PushTime > GeneralSettings.LastLookNoticeDateTime.Value)
{
item.Unread = true;

UnreadNotificationsCount++;
}
}
Expand All @@ -75,6 +74,7 @@ public void VerifyNotificationsHasRead()
//}
var notice = Notices.First(x => x.Unread == true);
INotificationService.Instance.Notify(notice.Content, NotificationType.Announcement, title: notice.Title);
GeneralSettings.LastLookNoticeDateTime.Value = DateTimeOffset.Now;
}
}
}
Expand Down

0 comments on commit 6ceaeb0

Please sign in to comment.