From deb66436cb516934efdc8bee9853a2c0e9e4583a Mon Sep 17 00:00:00 2001 From: arkon Date: Fri, 17 Apr 2020 20:22:46 -0400 Subject: [PATCH] Remove redundant call to set extension badge in bottom nav --- .../main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt index 084f019ea9..fa0f4980c7 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt +++ b/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 {