From 6ceaeb0710cc8c3124fd2acb1fcebbaec09e1c2c Mon Sep 17 00:00:00 2001 From: RMBGAME Date: Mon, 23 Sep 2024 17:45:46 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20=E9=80=9A=E7=9F=A5=E6=B6=88?= =?UTF-8?q?=E6=81=AF=E5=BC=B9=E5=87=BA=E4=B8=8D=E5=86=8D=E9=87=8D=E5=A4=8D?= =?UTF-8?q?=E5=BC=B9=E5=87=BA=E5=90=8C=E6=A0=B7=E6=B6=88=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/BD.WTTS.Client/Services/Mvvm/NoticeService.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/BD.WTTS.Client/Services/Mvvm/NoticeService.cs b/src/BD.WTTS.Client/Services/Mvvm/NoticeService.cs index da5754cc776..49b7df29e76 100644 --- a/src/BD.WTTS.Client/Services/Mvvm/NoticeService.cs +++ b/src/BD.WTTS.Client/Services/Mvvm/NoticeService.cs @@ -28,9 +28,9 @@ public NoticeService() { Notices = new ObservableCollection(); - _timer = new Timer(async _ => + _timer = new Timer(_ => { - await GetNewsAsync(); + GetNewsAsync().Wait(); }, null, TimeSpan.FromHours(2), TimeSpan.FromHours(2)); //NoticesSource = new(x => x.Id); @@ -60,7 +60,6 @@ public void VerifyNotificationsHasRead() if (item.PushTime > GeneralSettings.LastLookNoticeDateTime.Value) { item.Unread = true; - UnreadNotificationsCount++; } } @@ -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; } } }