mirror of
https://github.com/wanghongenpin/proxypin.git
synced 2026-05-14 15:48:03 +08:00
fix: ensure configuration is flushed on enable change
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ import 'dart:io';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:proxypin/ui/configuration.dart';
|
||||
import 'package:proxypin/ui/desktop/window_listener.dart';
|
||||
import 'package:window_manager/window_manager.dart';
|
||||
|
||||
import '../network/util/logger.dart';
|
||||
|
||||
Reference in New Issue
Block a user