From e48810d944293421ee376dbc9b58126202ed7e01 Mon Sep 17 00:00:00 2001 From: Mygod Date: Fri, 29 Oct 2021 22:50:48 -0400 Subject: [PATCH] Ensure updateItem is disabled if invisible --- mobile/src/main/java/be/mygod/vpnhotspot/MainActivity.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mobile/src/main/java/be/mygod/vpnhotspot/MainActivity.kt b/mobile/src/main/java/be/mygod/vpnhotspot/MainActivity.kt index 11347aa5..e5c99c59 100644 --- a/mobile/src/main/java/be/mygod/vpnhotspot/MainActivity.kt +++ b/mobile/src/main/java/be/mygod/vpnhotspot/MainActivity.kt @@ -79,7 +79,10 @@ class MainActivity : AppCompatActivity(), NavigationBarView.OnItemSelectedListen private fun onAppUpdateAvailable(update: AppUpdate?) { lastUpdate = update updateItem.isVisible = update != null - if (update == null) return + if (update == null) { + updateItem.isEnabled = false + return + } updateItem.isEnabled = update.downloaded != false updateItem.setIcon(when (update.downloaded) { null -> R.drawable.ic_action_update