From a51844e61947df3273279af9a8992b1f7cc5f43a Mon Sep 17 00:00:00 2001 From: Mike Scamell Date: Mon, 28 Oct 2024 13:54:19 +0100 Subject: [PATCH] Show on App Launch: Fix no option selected on rotation (#5200) Task/Issue URL: https://app.asana.com/0/1207908166761516/1208637287651029/f ### Description Fixes no options being selected then the phone is rotated. ### Steps to test this PR - [x] Open Show on App Launch screen in settings - [x] Rotate phone to landscape - [x] The same option that was selected should still be selected ### Demo https://github.com/user-attachments/assets/2fabd7ae-15c5-41e6-8b04-c78c13483d71 --- .../generalsettings/showonapplaunch/ShowOnAppLaunchActivity.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/com/duckduckgo/app/generalsettings/showonapplaunch/ShowOnAppLaunchActivity.kt b/app/src/main/java/com/duckduckgo/app/generalsettings/showonapplaunch/ShowOnAppLaunchActivity.kt index d666c257c284..e9adfa8fca54 100644 --- a/app/src/main/java/com/duckduckgo/app/generalsettings/showonapplaunch/ShowOnAppLaunchActivity.kt +++ b/app/src/main/java/com/duckduckgo/app/generalsettings/showonapplaunch/ShowOnAppLaunchActivity.kt @@ -92,7 +92,7 @@ class ShowOnAppLaunchActivity : DuckDuckGoActivity() { private fun observeViewModel() { viewModel.viewState - .flowWithLifecycle(lifecycle, Lifecycle.State.STARTED) + .flowWithLifecycle(lifecycle, Lifecycle.State.RESUMED) .onEach { viewState -> when (viewState.selectedOption) { LastOpenedTab -> {