From faef35ec4758b9a14bbcddb9a8edc20b7b623769 Mon Sep 17 00:00:00 2001 From: Hunter Nickel Date: Mon, 16 Aug 2021 09:58:30 -0600 Subject: [PATCH] Add check for current controller before setting extension update tab badge (#5733) --- .../java/eu/kanade/tachiyomi/ui/browse/BrowseController.kt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/BrowseController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/BrowseController.kt index bdd5ebb02..e40855e1a 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/BrowseController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/BrowseController.kt @@ -92,6 +92,11 @@ class BrowseController : } 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 { val updates = preferences.extensionUpdatesCount().get() if (updates > 0) {