mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-08-19 23:19:14 +02:00
Remove redundant call to set extension badge in bottom nav
This commit is contained in:
parent
b8152dd7f9
commit
deb66436cb
@ -143,9 +143,8 @@ class MainActivity : BaseActivity() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
setExtensionsBadge()
|
|
||||||
preferences.extensionUpdatesCount().asFlow()
|
preferences.extensionUpdatesCount().asFlow()
|
||||||
.onEach { setExtensionsBadge() }
|
.onEach { setExtensionsBadge(it) }
|
||||||
.launchInUI()
|
.launchInUI()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -160,8 +159,7 @@ class MainActivity : BaseActivity() {
|
|||||||
getExtensionUpdates()
|
getExtensionUpdates()
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun setExtensionsBadge() {
|
private fun setExtensionsBadge(updates: Int) {
|
||||||
val updates = preferences.extensionUpdatesCount().get()
|
|
||||||
if (updates > 0) {
|
if (updates > 0) {
|
||||||
binding.bottomNav.getOrCreateBadge(R.id.nav_more).number = updates
|
binding.bottomNav.getOrCreateBadge(R.id.nav_more).number = updates
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user