mirror of
https://github.com/clash-verge-rev/clash-verge-rev
synced 2025-05-07 21:05:44 +08:00
fix: do not reset system proxy when consistent
This commit is contained in:
parent
d3735c4763
commit
8a443013c0
@ -87,6 +87,14 @@ impl Sysopt {
|
|||||||
/// reset the sysproxy
|
/// reset the sysproxy
|
||||||
pub fn reset_sysproxy(&mut self) {
|
pub fn reset_sysproxy(&mut self) {
|
||||||
if let Some(sysproxy) = self.old_sysproxy.take() {
|
if let Some(sysproxy) = self.old_sysproxy.take() {
|
||||||
|
// 如果原代理设置是开启的,且域名端口设置和当前的一致,就不恢复原设置
|
||||||
|
// https://github.com/zzzgydi/clash-verge/issues/157
|
||||||
|
if let Some(cur) = self.cur_sysproxy.as_ref() {
|
||||||
|
if sysproxy.enable && cur.server == sysproxy.server {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
match sysproxy.set_sys() {
|
match sysproxy.set_sys() {
|
||||||
Ok(_) => self.cur_sysproxy = None,
|
Ok(_) => self.cur_sysproxy = None,
|
||||||
Err(_) => log::error!(target: "app", "failed to reset proxy"),
|
Err(_) => log::error!(target: "app", "failed to reset proxy"),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user