mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-01-29 08:45:41 +08:00
Fix and Optimize
fix: #3187 and #3096, silent startup can not trigger lightweight mode fix: optimize startup initializing processing
This commit is contained in:
@@ -188,7 +188,7 @@ impl Hotkey {
|
||||
true,
|
||||
"Window does not exist, creating a new one"
|
||||
);
|
||||
resolve::create_window();
|
||||
resolve::create_window(true);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use crate::{config::Config, core::CoreManager, feat};
|
||||
use crate::{config::Config, core::CoreManager, feat, logging, utils::logging::Type};
|
||||
use anyhow::{Context, Result};
|
||||
use delay_timer::prelude::{DelayTimer, DelayTimerBuilder, TaskBuilder};
|
||||
use once_cell::sync::OnceCell;
|
||||
@@ -58,7 +58,7 @@ impl Timer {
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
log::info!(target: "app", "Initializing timer...");
|
||||
logging!(info, Type::Timer, true, "Initializing timer...");
|
||||
|
||||
// Initialize timer tasks
|
||||
if let Err(e) = self.refresh() {
|
||||
|
||||
@@ -205,7 +205,7 @@ impl Tray {
|
||||
match tray_event.as_str() {
|
||||
"system_proxy" => feat::toggle_system_proxy(),
|
||||
"tun_mode" => feat::toggle_tun_mode(None),
|
||||
"main_window" => resolve::create_window(),
|
||||
"main_window" => resolve::create_window(true),
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
@@ -680,7 +680,7 @@ fn on_menu_event(_: &AppHandle, event: MenuEvent) {
|
||||
println!("change mode to: {}", mode);
|
||||
feat::change_clash_mode(mode.into());
|
||||
}
|
||||
"open_window" => resolve::create_window(),
|
||||
"open_window" => resolve::create_window(true),
|
||||
"system_proxy" => feat::toggle_system_proxy(),
|
||||
"tun_mode" => feat::toggle_tun_mode(None),
|
||||
"copy_env" => feat::copy_clash_env(),
|
||||
|
||||
Reference in New Issue
Block a user