Skip to content

Commit a001b43

Browse files
author
Evan Masseau
committed
Persisting the webview uncovered an issue with presenting a second form after device rotation.
1 parent 1132908 commit a001b43

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

sdk/forms/src/main/java/com/klaviyo/forms/presentation/KlaviyoPresentationManager.kt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,12 @@ internal class KlaviyoPresentationManager() : PresentationManager {
3333
*/
3434
private fun onActivityEvent(event: ActivityEvent) = when (event) {
3535
is ActivityEvent.Created -> event.activity.takeIf<KlaviyoFormsOverlayActivity>()?.let { activity ->
36-
val formId = presentationState.takeIf<PresentationState.Presenting>()?.formId
37-
overlayActivity = activity
38-
Registry.get<WebViewClient>().attachWebView(activity)
39-
presentationState = PresentationState.Presented(formId)
36+
presentationState.takeIf<PresentationState.Presenting>()?.let {
37+
overlayActivity = activity
38+
Registry.get<WebViewClient>().attachWebView(activity)
39+
presentationState = PresentationState.Presented(it.formId)
40+
Registry.log.debug("Finished presenting activity, now in state: $presentationState")
41+
}
4042
}
4143

4244
is ActivityEvent.ConfigurationChanged -> presentationState.takeIfNot<PresentationState.Hidden>()?.let {

0 commit comments

Comments
 (0)