瀏覽代碼

Fix Incognito Mode toggle not updating after disabled via notification

arkon 3 年之前
父節點
當前提交
52416ff3a8
共有 1 個文件被更改,包括 6 次插入0 次删除
  1. 6 0
      app/src/main/java/eu/kanade/tachiyomi/ui/more/MoreController.kt

+ 6 - 0
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 {