Skip to content

Commit

Permalink
fix: HS-158:minor refactor in ApplePay file (#20)
Browse files Browse the repository at this point in the history
Co-authored-by: arun.mishra <[email protected]>
  • Loading branch information
arun-mi and arun.mishra authored Nov 13, 2023
1 parent b93cdef commit 3da29ab
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Payments/ApplePay.res
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down Expand Up @@ -263,8 +268,6 @@ let default = (props: props) => {
)
}, [isInvokeSDKFlow])

setIsShowOrPayUsing(.prev => prev || showApplePay)

<div>
<style> {React.string(css)} </style>
{if showApplePay {
Expand Down

0 comments on commit 3da29ab

Please sign in to comment.