fix: Do not set autolaunch at init

#423 #424
This commit is contained in:
MystiPanda 2024-02-21 23:50:50 +08:00
parent dcd6c1f522
commit 36a3c5b501

View File

@ -204,28 +204,6 @@ impl Sysopt {
.set_app_path(&app_path) .set_app_path(&app_path)
.build()?; .build()?;
// 避免在开发时将自启动关了
#[cfg(feature = "verge-dev")]
if !enable {
return Ok(());
}
#[cfg(target_os = "macos")]
{
if enable && !auto.is_enabled().unwrap_or(false) {
// 避免重复设置登录项
let _ = auto.disable();
auto.enable()?;
} else if !enable {
let _ = auto.disable();
}
}
#[cfg(not(target_os = "macos"))]
if enable {
auto.enable()?;
}
*self.auto_launch.lock() = Some(auto); *self.auto_launch.lock() = Some(auto);
Ok(()) Ok(())