fix: tun mode config

This commit is contained in:
GyDi
2022-03-15 14:23:57 +08:00
committed by GitHub
parent 9b9865f717
commit 4c39d37ad5
2 changed files with 58 additions and 21 deletions

View File

@@ -285,9 +285,6 @@ pub fn patch_verge_config(
) -> Result<(), String> {
let tun_mode = payload.enable_tun_mode.clone();
let mut verge = verge_state.0.lock().unwrap();
wrap_err!(verge.patch_config(payload))?;
// change tun mode
if tun_mode.is_some() {
let mut clash = clash_state.0.lock().unwrap();
@@ -298,6 +295,9 @@ pub fn patch_verge_config(
wrap_err!(clash.activate(&profiles, false))?;
}
let mut verge = verge_state.0.lock().unwrap();
wrap_err!(verge.patch_config(payload))?;
Ok(())
}