Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: added suspense and error boundary for apple pay and google pay in tabs #632

Merged
merged 4 commits into from
Sep 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 16 additions & 12 deletions src/PaymentElement.res
Original file line number Diff line number Diff line change
Expand Up @@ -328,24 +328,28 @@ let make = (~cardProps, ~expiryProps, ~cvcProps, ~paymentType: CardThemeType.mod
| ApplePay =>
switch applePayToken {
| ApplePayTokenOptional(optToken) =>
<ApplePayLazy sessionObj=optToken walletOptions paymentType />
<ReusableReactSuspense loaderComponent={loader()} componentName="ApplePayLazy">
<ApplePayLazy sessionObj=optToken walletOptions paymentType />
</ReusableReactSuspense>
| _ => React.null
}
| GooglePay =>
<SessionPaymentWrapper type_={Wallet}>
{switch gPayToken {
| OtherTokenOptional(optToken) =>
switch googlePayThirdPartyToken {
| GooglePayThirdPartyTokenOptional(googlePayThirdPartyOptToken) =>
<GPayLazy
sessionObj=optToken
thirdPartySessionObj=googlePayThirdPartyOptToken
walletOptions
paymentType
/>
| _ =>
<GPayLazy sessionObj=optToken thirdPartySessionObj=None walletOptions paymentType />
}
<ReusableReactSuspense loaderComponent={loader()} componentName="GPayLazy">
{switch googlePayThirdPartyToken {
| GooglePayThirdPartyTokenOptional(googlePayThirdPartyOptToken) =>
<GPayLazy
sessionObj=optToken
thirdPartySessionObj=googlePayThirdPartyOptToken
walletOptions
paymentType
/>
| _ =>
<GPayLazy sessionObj=optToken thirdPartySessionObj=None walletOptions paymentType />
}}
</ReusableReactSuspense>
| _ => React.null
}}
</SessionPaymentWrapper>
Expand Down
Loading