fix: ensure configuration is flushed on enable change

This commit is contained in:
wanghongenpin
2026-05-08 03:41:00 +08:00
parent e0b29cf08f
commit cd86e1dbcb
2 changed files with 2 additions and 7 deletions

View File

@@ -381,16 +381,10 @@ class _SwitchState extends State<_Switch> {
changed = true;
widget.onEnableChange(val);
CertificateManager.cleanCache();
widget.proxyServer.configuration.flushConfig();
setState(() {});
}))
]));
}
@override
void dispose() {
super.dispose();
if (changed) {
widget.proxyServer.configuration.flushConfig();
}
}
}