From 52416ff3a85bd6f17fb12f218398c5c9fd198397 Mon Sep 17 00:00:00 2001 From: arkon Date: Sun, 11 Jul 2021 15:17:43 -0400 Subject: [PATCH] Fix Incognito Mode toggle not updating after disabled via notification --- .../main/java/eu/kanade/tachiyomi/ui/more/MoreController.kt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/more/MoreController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/more/MoreController.kt index b0b69c5728..cef1736c6d 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/more/MoreController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/more/MoreController.kt @@ -29,6 +29,8 @@ import eu.kanade.tachiyomi.util.preference.switchPreference import eu.kanade.tachiyomi.util.preference.titleRes import eu.kanade.tachiyomi.util.system.getResourceColor import eu.kanade.tachiyomi.util.system.openInBrowser +import kotlinx.coroutines.flow.launchIn +import kotlinx.coroutines.flow.onEach import rx.Observable import rx.Subscription import rx.android.schedulers.AndroidSchedulers @@ -70,6 +72,10 @@ class MoreController : iconRes = R.drawable.ic_glasses_24dp iconTint = tintColor defaultValue = false + + preferences.incognitoMode().asFlow() + .onEach { isChecked = it } + .launchIn(viewScope) } preferenceCategory {