From 8f3720da9ae84d4c16680f47a6e0a0afc60d89e1 Mon Sep 17 00:00:00 2001 From: oomeow Date: Thu, 30 Oct 2025 00:32:57 +0800 Subject: [PATCH] fix: notification can not notify frontend (#5243) --- src-tauri/src/core/notification.rs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src-tauri/src/core/notification.rs b/src-tauri/src/core/notification.rs index 08102fc0..071bcedb 100644 --- a/src-tauri/src/core/notification.rs +++ b/src-tauri/src/core/notification.rs @@ -96,10 +96,17 @@ impl NotificationSystem { let handle = Handle::global(); while !handle.is_exiting() { - match rx.recv_timeout(std::time::Duration::from_millis(100)) { + match rx.recv() { Ok(event) => Self::process_event(handle, event), - Err(mpsc::RecvTimeoutError::Disconnected) => break, - Err(mpsc::RecvTimeoutError::Timeout) => break, + Err(e) => { + logging!( + error, + Type::System, + "receive event error, stop notification worker: {}", + e + ); + break; + } } } }