Fixed removal of proxy config not done if matching auth info wasn't found

This commit is contained in:
Sylvain Berfini 2020-07-20 11:03:23 +02:00
parent a2b0b04483
commit b67b91d95a

View file

@ -139,10 +139,14 @@ class AccountSettingsViewModel(val proxyConfig: ProxyConfig) : GenericSettingsVi
private fun deleteProxyConfig(cfg: ProxyConfig) { private fun deleteProxyConfig(cfg: ProxyConfig) {
val authInfo = cfg.findAuthInfo() val authInfo = cfg.findAuthInfo()
if (authInfo != null) { if (authInfo != null) {
core.removeProxyConfig(cfg) Log.i("[Account Settings] Found auth info $authInfo, removing it.")
core.removeAuthInfo(authInfo) core.removeAuthInfo(authInfo)
proxyConfigRemovedEvent.value = Event(true) } else {
Log.w("[Account Settings] Couldn't find matching auth info...")
} }
core.removeProxyConfig(cfg)
proxyConfigRemovedEvent.value = Event(true)
} }
val deleteListener = object : SettingListenerStub() { val deleteListener = object : SettingListenerStub() {