mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-11-19 02:12:10 +08:00
fix(tun): make the TUN switch reflect what the Core actually runs
The switch read enable_tun_mode while the Core was given enable_tun_mode && !session_suppression, so falling back to Sidecar left it showing a TUN that was not running, with nothing to write the flag back. Drop the session flag: the stored preference is the only truth, re-checked at startup and written off when the conditions for it are not met, and the switch renders it against current capability.
This commit is contained in:
@@ -95,7 +95,7 @@ impl RunState {
|
||||
!matches!(self.health, ServiceHealth::Unknown) && !self.op_in_flight && !self.service_needs_attention()
|
||||
}
|
||||
|
||||
/// Present-but-broken services remain in the repair flow rather than suppressing TUN.
|
||||
/// Present-but-broken services remain in the repair flow rather than being disabled here.
|
||||
#[must_use]
|
||||
pub const fn startup_tun_should_be_disabled(&self, tun_enabled: bool) -> bool {
|
||||
matches!(self.health, ServiceHealth::NotInstalled) && self.tun_should_be_disabled(tun_enabled)
|
||||
|
||||
Reference in New Issue
Block a user