From cd25e1283a1f3dd38760982e0bfc6d4d62b04868 Mon Sep 17 00:00:00 2001 From: arkon Date: Sun, 19 Apr 2020 23:10:28 -0400 Subject: [PATCH] Fix extension update badge again --- .../java/eu/kanade/tachiyomi/ui/main/MainActivity.kt | 9 +++++---- 1 file changed, 5 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 c75314dc75..8e4130ae34 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 @@ -13,7 +13,6 @@ import com.bluelinelabs.conductor.RouterTransaction import eu.kanade.tachiyomi.Migrations import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.data.notification.NotificationReceiver -import eu.kanade.tachiyomi.data.preference.asImmediateFlow import eu.kanade.tachiyomi.databinding.MainActivityBinding import eu.kanade.tachiyomi.extension.api.ExtensionGithubApi import eu.kanade.tachiyomi.ui.base.activity.BaseActivity @@ -154,8 +153,9 @@ class MainActivity : BaseActivity() { } } - preferences.extensionUpdatesCount().asImmediateFlow() - .onEach { setExtensionsBadge(it) } + setExtensionsBadge() + preferences.extensionUpdatesCount().asFlow() + .onEach { setExtensionsBadge() } .launchInUI() } @@ -170,7 +170,8 @@ class MainActivity : BaseActivity() { getExtensionUpdates() } - private fun setExtensionsBadge(updates: Int) { + private fun setExtensionsBadge() { + val updates = preferences.extensionUpdatesCount().get() if (updates > 0) { binding.bottomNav.getOrCreateBadge(R.id.nav_more).number = updates } else {