瀏覽代碼

Add check for current controller before setting extension update tab badge (#5733)

Hunter Nickel 3 年之前
父節點
當前提交
faef35ec47
共有 1 個文件被更改,包括 5 次插入0 次删除
  1. 5 0
      app/src/main/java/eu/kanade/tachiyomi/ui/browse/BrowseController.kt

+ 5 - 0
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) {