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

pull/5737/head
Hunter Nickel 3 years ago committed by GitHub
parent 326d4c2641
commit faef35ec47
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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) {

Loading…
Cancel
Save