mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-01-29 17:15:38 +08:00
Revert "feat: update Cargo.toml for 2024 edition and optimize release profiles (#4681)"
This reverts commit 31e3104c7f.
This commit is contained in:
@@ -2,9 +2,8 @@ use crate::singleton;
|
||||
use parking_lot::RwLock;
|
||||
use std::{
|
||||
sync::{
|
||||
Arc,
|
||||
atomic::{AtomicU64, Ordering},
|
||||
mpsc,
|
||||
mpsc, Arc,
|
||||
},
|
||||
thread,
|
||||
time::{Duration, Instant},
|
||||
@@ -99,14 +98,16 @@ impl NotificationSystem {
|
||||
|
||||
let is_emergency = *system.emergency_mode.read();
|
||||
|
||||
if is_emergency
|
||||
&& let FrontendEvent::NoticeMessage { ref status, .. } = event
|
||||
&& status == "info" {
|
||||
if is_emergency {
|
||||
if let FrontendEvent::NoticeMessage { ref status, .. } = event {
|
||||
if status == "info" {
|
||||
log::warn!(
|
||||
"Emergency mode active, skipping info message"
|
||||
);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if let Some(window) = handle.get_window() {
|
||||
*system.last_emit_time.write() = Instant::now();
|
||||
@@ -202,12 +203,13 @@ impl NotificationSystem {
|
||||
|
||||
/// 发送事件到队列
|
||||
fn send_event(&self, event: FrontendEvent) -> bool {
|
||||
if *self.emergency_mode.read()
|
||||
&& let FrontendEvent::NoticeMessage { ref status, .. } = event
|
||||
&& status == "info"
|
||||
{
|
||||
log::info!("Skipping info message in emergency mode");
|
||||
return false;
|
||||
if *self.emergency_mode.read() {
|
||||
if let FrontendEvent::NoticeMessage { ref status, .. } = event {
|
||||
if status == "info" {
|
||||
log::info!("Skipping info message in emergency mode");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if let Some(sender) = &self.sender {
|
||||
@@ -390,9 +392,7 @@ impl Handle {
|
||||
if let Some(system) = system_opt.as_ref() {
|
||||
system.send_event(FrontendEvent::ProfileUpdateStarted { uid });
|
||||
} else {
|
||||
log::warn!(
|
||||
"Notification system not initialized when trying to send ProfileUpdateStarted event."
|
||||
);
|
||||
log::warn!("Notification system not initialized when trying to send ProfileUpdateStarted event.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -406,9 +406,7 @@ impl Handle {
|
||||
if let Some(system) = system_opt.as_ref() {
|
||||
system.send_event(FrontendEvent::ProfileUpdateCompleted { uid });
|
||||
} else {
|
||||
log::warn!(
|
||||
"Notification system not initialized when trying to send ProfileUpdateCompleted event."
|
||||
);
|
||||
log::warn!("Notification system not initialized when trying to send ProfileUpdateCompleted event.");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user