From 3da29abd1c2c5dd8496c47ec87531b1e3713f359 Mon Sep 17 00:00:00 2001 From: Arun Mishra <68141066+arun-mi@users.noreply.github.com> Date: Mon, 13 Nov 2023 14:37:13 +0530 Subject: [PATCH] fix: HS-158:minor refactor in ApplePay file (#20) Co-authored-by: arun.mishra --- src/Payments/ApplePay.res | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Payments/ApplePay.res b/src/Payments/ApplePay.res index cc8ba8282..40f93b24a 100644 --- a/src/Payments/ApplePay.res +++ b/src/Payments/ApplePay.res @@ -223,6 +223,11 @@ let default = (props: props) => { } } + React.useEffect0(() => { + setIsShowOrPayUsing(.prev => prev || showApplePay) + None + }) + React.useEffect1(() => { Utils.handlePostMessage([("applePayMounted", true->Js.Json.boolean)]) let handleApplePayMessages = (ev: Window.event) => { @@ -263,8 +268,6 @@ let default = (props: props) => { ) }, [isInvokeSDKFlow]) - setIsShowOrPayUsing(.prev => prev || showApplePay) -
{if showApplePay {