Call initProxy() manually

This commit is contained in:
yushijinhun
2018-07-20 15:59:05 +08:00
parent c38848ea0e
commit 357fef8672
2 changed files with 3 additions and 7 deletions

View File

@@ -36,7 +36,7 @@ public final class ProxyManager {
private ProxyManager() {
}
private static final ObjectBinding<Proxy> proxyProperty = Bindings.createObjectBinding(
private static ObjectBinding<Proxy> proxyProperty = Bindings.createObjectBinding(
() -> {
String host = CONFIG.getProxyHost();
Integer port = Lang.toIntOrNull(CONFIG.getProxyPort());
@@ -59,11 +59,7 @@ public final class ProxyManager {
return proxyProperty;
}
static {
initProxy();
}
private static void initProxy() {
static void init() {
proxyProperty.addListener(observable -> updateSystemProxy());
updateSystemProxy();

View File

@@ -66,7 +66,7 @@ public class Settings {
firstLaunch = CONFIG.isFirstLaunch();
CONFIG.setFirstLaunch(false);
ProxyManager.getProxy(); // init ProxyManager
ProxyManager.init();
for (Iterator<Map<Object, Object>> iterator = CONFIG.getAccounts().iterator(); iterator.hasNext();) {
Map<Object, Object> settings = iterator.next();