Browse Source

Remove redundant call to set extension badge in bottom nav

arkon 5 years ago
parent
commit
deb66436cb
1 changed files with 2 additions and 4 deletions
  1. 2 4
      app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt

+ 2 - 4
app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt

@@ -143,9 +143,8 @@ class MainActivity : BaseActivity() {
             }
         }
 
-        setExtensionsBadge()
         preferences.extensionUpdatesCount().asFlow()
-            .onEach { setExtensionsBadge() }
+            .onEach { setExtensionsBadge(it) }
             .launchInUI()
     }
 
@@ -160,8 +159,7 @@ class MainActivity : BaseActivity() {
         getExtensionUpdates()
     }
 
-    private fun setExtensionsBadge() {
-        val updates = preferences.extensionUpdatesCount().get()
+    private fun setExtensionsBadge(updates: Int) {
         if (updates > 0) {
             binding.bottomNav.getOrCreateBadge(R.id.nav_more).number = updates
         } else {