From e99775c22cad1f7b08d9c975d9ce53d6637fbcbe Mon Sep 17 00:00:00 2001 From: rising-dragon401 Date: Tue, 14 May 2024 16:37:35 +0530 Subject: [PATCH] fix: do not unmount preMountLoader iframe (#367) --- src/Payments/PreMountLoader.res | 1 - src/orca-loader/Elements.res | 9 --------- 2 files changed, 10 deletions(-) diff --git a/src/Payments/PreMountLoader.res b/src/Payments/PreMountLoader.res index 3b531e0..79220b1 100644 --- a/src/Payments/PreMountLoader.res +++ b/src/Payments/PreMountLoader.res @@ -96,7 +96,6 @@ let make = (~sessionId, ~publishableKey, ~clientSecret, ~endpoint) => { if ( paymentMethodsResponseSent && customerPaymentMethodsResponseSent && sessionTokensResponseSent ) { - handlePostMessage([("preMountLoaderIframeUnMount", true->JSON.Encode.bool)]) Window.removeEventListener("message", handle) } None diff --git a/src/orca-loader/Elements.res b/src/orca-loader/Elements.res index 96ba341..095d1cd 100644 --- a/src/orca-loader/Elements.res +++ b/src/orca-loader/Elements.res @@ -89,21 +89,12 @@ let make = ( let preMountLoaderIframeDiv = mountPreMountLoaderIframe() - let unMountPreMountLoaderIframe = () => { - switch preMountLoaderIframeDiv->Nullable.toOption { - | Some(iframe) => iframe->remove - | None => () - } - } - let preMountLoaderMountedPromise = Promise.make((resolve, _reject) => { let preMountLoaderIframeCallback = (ev: Types.event) => { let json = ev.data->Identity.anyTypeToJson let dict = json->Utils.getDictFromJson if dict->Dict.get("preMountLoaderIframeMountedCallback")->Option.isSome { resolve(true->JSON.Encode.bool) - } else if dict->Dict.get("preMountLoaderIframeUnMount")->Option.isSome { - unMountPreMountLoaderIframe() } } addSmartEventListener(