TunnelListFragment: set selection on Main, not Main.immediate

Otherwise, we crash when saving the config.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
Jason A. Donenfeld 2020-09-15 16:07:16 +02:00
parent 601b58b670
commit 80c35a2053

View File

@ -221,7 +221,7 @@ class TunnelListFragment : BaseFragment() {
override fun onSelectedTunnelChanged(oldTunnel: ObservableTunnel?, newTunnel: ObservableTunnel?) {
binding ?: return
GlobalScope.launch(Dispatchers.Main.immediate) {
GlobalScope.launch(Dispatchers.Main) {
val tunnels = Application.getTunnelManager().getTunnels()
if (newTunnel != null) viewForTunnel(newTunnel, tunnels).setSingleSelected(true)
if (oldTunnel != null) viewForTunnel(oldTunnel, tunnels).setSingleSelected(false)