Do not show alert after turning off the proxy.

This commit is contained in:
Zhongyi Tong
2017-08-21 11:10:01 -04:00
parent 86674991c1
commit 5cd0c1ca4e
2 changed files with 6 additions and 4 deletions

View File

@@ -305,9 +305,11 @@ class ServerManagerView {
this.activateTab(index);
});
ipcRenderer.on('reload-proxy', () => {
ipcRenderer.on('reload-proxy', (event, showAlert) => {
this.loadProxy().then(() => {
alert('Proxy settings saved!');
if (showAlert) {
alert('Proxy settings saved!');
}
});
});

View File

@@ -63,7 +63,7 @@ class NetworkSection extends BaseSection {
ConfigUtil.setConfigItem('proxyRules', this.$proxyRules.value);
ConfigUtil.setConfigItem('proxyBypass', this.$proxyBypass.value);
ipcRenderer.send('forward-message', 'reload-proxy');
ipcRenderer.send('forward-message', 'reload-proxy', true);
});
}
@@ -91,7 +91,7 @@ class NetworkSection extends BaseSection {
this.toggleProxySettings(newValue);
if (newValue === false) {
// Reload proxy if the proxy is turned off
ipcRenderer.send('forward-message', 'reload-proxy');
ipcRenderer.send('forward-message', 'reload-proxy', false);
}
this.updateProxyOption();
}