Commit 52d9d079 authored by Daniel Wolf's avatar Daniel Wolf
Browse files

Always re-show current server

parent c0c4a374
...@@ -63,7 +63,6 @@ class MainFragment : Fragment() { ...@@ -63,7 +63,6 @@ class MainFragment : Fragment() {
private var proxyState:ProxyState = ProxyState.NOT_RUNNING private var proxyState:ProxyState = ProxyState.NOT_RUNNING
private var vpnStateReceiver: BroadcastReceiver? = null private var vpnStateReceiver: BroadcastReceiver? = null
private var latencyCheckJob:Job? = null private var latencyCheckJob:Job? = null
private var currentDisplayedServerHash:Int? = null
override fun onCreateView( override fun onCreateView(
inflater: LayoutInflater, inflater: LayoutInflater,
...@@ -83,9 +82,7 @@ class MainFragment : Fragment() { ...@@ -83,9 +82,7 @@ class MainFragment : Fragment() {
if(proxyState != previousProxyState) { if(proxyState != previousProxyState) {
updateVpnIndicators() updateVpnIndicators()
} }
if(proxyState != previousProxyState || currentDisplayedServerHash == null) {
displayServer(getPreferences().dnsServerConfig) displayServer(getPreferences().dnsServerConfig)
}
runLatencyCheck() runLatencyCheck()
} }
...@@ -207,8 +204,6 @@ class MainFragment : Fragment() { ...@@ -207,8 +204,6 @@ class MainFragment : Fragment() {
} }
private fun displayServer(config: DnsServerInformation<*>) { private fun displayServer(config: DnsServerInformation<*>) {
if(config.hashCode() == currentDisplayedServerHash) return
currentDisplayedServerHash = config.hashCode()
serverName.text = config.name serverName.text = config.name
serverURL.text = when(config.type) { serverURL.text = when(config.type) {
ServerType.DOH -> (config as HttpsDnsServerInformation).servers.firstOrNull()?.address?.getUrl( ServerType.DOH -> (config as HttpsDnsServerInformation).servers.firstOrNull()?.address?.getUrl(
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment