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). (cherry picked from commit 3c186a3c8d3fd74f489a7aa2a27906d29502e0f6)
This commit is contained in:
parent
b18075de14
commit
dd4384767c
@ -104,9 +104,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 ->
|
||||
|
@ -249,6 +249,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
|
||||
// TODO
|
||||
// if (Migrations.upgrade(preferences) && !BuildConfig.DEBUG) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user