mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-11-10 11:57:47 +01:00
Add check for current controller before setting extension update tab badge (#5733)
This commit is contained in:
parent
326d4c2641
commit
faef35ec47
1 changed files with 5 additions and 0 deletions
|
@ -92,6 +92,11 @@ class BrowseController :
|
||||||
}
|
}
|
||||||
|
|
||||||
fun setExtensionUpdateBadge() {
|
fun setExtensionUpdateBadge() {
|
||||||
|
/* It's possible to switch to the Library controller by the time setExtensionUpdateBadge
|
||||||
|
is called, resulting in a badge being put on the category tabs (if enabled).
|
||||||
|
This check prevents that from happening */
|
||||||
|
if (router.backstack.last().controller !is BrowseController) return
|
||||||
|
|
||||||
(activity as? MainActivity)?.binding?.tabs?.apply {
|
(activity as? MainActivity)?.binding?.tabs?.apply {
|
||||||
val updates = preferences.extensionUpdatesCount().get()
|
val updates = preferences.extensionUpdatesCount().get()
|
||||||
if (updates > 0) {
|
if (updates > 0) {
|
||||||
|
|
Loading…
Reference in a new issue