fix: notification can not notify frontend (#5243)

This commit is contained in:
oomeow
2025-10-30 00:32:57 +08:00
committed by Tunglies
Unverified
parent d10665091b
commit fb09e6c85d
2 changed files with 11 additions and 3 deletions

View File

@@ -73,6 +73,7 @@
- 修复首页自定义卡片在切换轻量模式时失效
- 修复悬浮跳转导航失效
- 修复小键盘热键映射错误
- 修复后端无法通知前端事件
## v2.4.2

View File

@@ -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;
}
}
}
}