Albirew/tachiyomi
Archivé
1
0
Bifurcation 0

Fix incognito mode disabled after the app kicked out of memory (#5167)

The application class onCreate will also be called when user navigates to an
activity after the app process is killed by the system.

So make sure the incognito is disabled only when the entry point of the app is
created from scratch (e.g. after being force closed by the user).
Cette révision appartient à :
Ivan Iskandar 2021-05-24 20:09:35 +07:00 révisé par GitHub
Parent a462ce3626
révision 3c186a3c8d
Aucune clé n'a été trouvée pour cette signature dans la base de données
ID de la clé GPG: 4AEE18F83AFDEB23
2 fichiers modifiés avec 3 ajouts et 3 suppressions

Voir le fichier

@ -74,9 +74,6 @@ open class App : Application(), LifecycleObserver, ImageLoaderFactory {
ProcessLifecycleOwner.get().lifecycle.addObserver(this)
// Reset Incognito Mode on relaunch
preferences.incognitoMode().set(false)
// Show notification to disable Incognito Mode when it's enabled
preferences.incognitoMode().asFlow()
.onEach { enabled ->

Voir le fichier

@ -224,6 +224,9 @@ class MainActivity : BaseViewBindingActivity<MainActivityBinding>() {
syncActivityViewWithController(router.backstack.lastOrNull()?.controller())
if (savedInstanceState == null) {
// Reset Incognito Mode on relaunch
preferences.incognitoMode().set(false)
// Show changelog prompt on update
if (Migrations.upgrade(preferences) && !BuildConfig.DEBUG) {
WhatsNewDialogController().showDialog(router)