Call initProxy() manually

This commit is contained in:
yushijinhun committed 2018-07-20 20:26:27 +08:00
1 parent c38848ea0e
commit 357fef8672
2 files changed
+3 -7

No files matched your search

@@ -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();
@@ -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();