From 63cbc994312b1d8d63f583ca6a2f0b08c6922ea3 Mon Sep 17 00:00:00 2001 From: Matt Chowning Date: Thu, 27 Jul 2023 06:32:56 -0400 Subject: [PATCH] Continue to upgrade screen from google sign in when appropriate (#1204) Co-authored-by: ashiagr --- CHANGELOG.md | 3 +++ .../onboarding/OnboardingFlowComposable.kt | 16 +++++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 21e07a5674e..e8bedbb60aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,9 @@ ([#1009](https://github.com/Automattic/pocket-casts-android/pull/1009)) * Fixed swiping to open Up Next queue in landscape and on foldables ([#1209](https://github.com/Automattic/pocket-casts-android/pull/1209)) + * Fixed upgrade flow when signing in with Google account + ([#1204](https://github.com/Automattic/pocket-casts-android/pull/1204)) + 7.44 ----- diff --git a/modules/features/account/src/main/java/au/com/shiftyjelly/pocketcasts/account/onboarding/OnboardingFlowComposable.kt b/modules/features/account/src/main/java/au/com/shiftyjelly/pocketcasts/account/onboarding/OnboardingFlowComposable.kt index 80dd8ad7ebf..b5e847ae35d 100644 --- a/modules/features/account/src/main/java/au/com/shiftyjelly/pocketcasts/account/onboarding/OnboardingFlowComposable.kt +++ b/modules/features/account/src/main/java/au/com/shiftyjelly/pocketcasts/account/onboarding/OnboardingFlowComposable.kt @@ -125,7 +125,21 @@ private fun Content( if (state.isNewAccount) { onAccountCreated() } else { - exitOnboarding() + when (flow) { + OnboardingFlow.InitialOnboarding, + OnboardingFlow.LoggedOut, + is OnboardingFlow.PlusAccountUpgrade, + is OnboardingFlow.PlusUpsell -> exitOnboarding() + + is OnboardingFlow.PatronAccountUpgrade, + OnboardingFlow.PlusAccountUpgradeNeedsLogin -> + navController.navigate( + OnboardingNavRoute.PlusUpgrade.routeWithSource(OnboardingUpgradeSource.LOGIN) + ) { + // clear backstack after successful login + popUpTo(OnboardingNavRoute.logInOrSignUp) { inclusive = true } + } + } } }, )