diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2020-09-22 17:55:33 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2020-09-22 23:53:54 +0200 |
commit | eb8cab411057e6b8d75838550b9ac3665d38acd6 (patch) | |
tree | 0ee331612190da01e7b8134549daabdf44bb410c /ui/src/main/java/com/wireguard/android | |
parent | 0a36d9a5e99ec53aff1c6ecda377fc5fb2880ecc (diff) |
tv: do not redisplay stats when deleting
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'ui/src/main/java/com/wireguard/android')
-rw-r--r-- | ui/src/main/java/com/wireguard/android/activity/TvMainActivity.kt | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ui/src/main/java/com/wireguard/android/activity/TvMainActivity.kt b/ui/src/main/java/com/wireguard/android/activity/TvMainActivity.kt index 70165a26..7e3d425d 100644 --- a/ui/src/main/java/com/wireguard/android/activity/TvMainActivity.kt +++ b/ui/src/main/java/com/wireguard/android/activity/TvMainActivity.kt @@ -60,13 +60,13 @@ class TvMainActivity : AppCompatActivity() { } } - lateinit var binding: TvActivityBinding + private lateinit var binding: TvActivityBinding + private val isDeleting = ObservableBoolean() override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) binding = TvActivityBinding.inflate(layoutInflater) lifecycleScope.launch { binding.tunnels = Application.getTunnelManager().getTunnels() } - val isDeleting = ObservableBoolean() binding.isDeleting = isDeleting binding.rowConfigurationHandler = object : ObservableKeyedRecyclerViewAdapter.RowConfigurationHandler<TvTunnelListItemBinding, ObservableTunnel> { override fun onConfigureRow(binding: TvTunnelListItemBinding, item: ObservableTunnel, position: Int) { @@ -119,7 +119,7 @@ class TvMainActivity : AppCompatActivity() { val listItem = DataBindingUtil.findBinding<TvTunnelListItemBinding>(viewItem) ?: return@forEach try { val tunnel = listItem.item!! - if (tunnel.state != Tunnel.State.UP) { + if (tunnel.state != Tunnel.State.UP || isDeleting.get()) { throw Exception() } val statistics = tunnel.getStatisticsAsync() |