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: paynow button fix for required fields #364

Merged
merged 3 commits into from
May 10, 2024
Merged
Changes from 2 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
6 changes: 6 additions & 0 deletions src/Payments/GPay.res
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ let make = (
let setIsShowOrPayUsing = Recoil.useSetRecoilState(isShowOrPayUsing)
let areRequiredFieldsValid = Recoil.useRecoilValueFromAtom(RecoilAtoms.areRequiredFieldsValid)
let areRequiredFieldsEmpty = Recoil.useRecoilValueFromAtom(RecoilAtoms.areRequiredFieldsEmpty)
let setIsPayNowButtonDisable = Recoil.useSetRecoilState(payNowButtonDisable)
let status = CommonHooks.useScript("https://pay.google.com/gp/p/js/pay.js")
let isGooglePaySDKFlow = React.useMemo(() => {
sessionObj->Option.isSome
Expand Down Expand Up @@ -79,6 +80,11 @@ let make = (
)
}

React.useEffect(() => {
PritishBudhiraja marked this conversation as resolved.
Show resolved Hide resolved
setIsPayNowButtonDisable(_ => !areRequiredFieldsValid)
None
}, [areRequiredFieldsValid])

React.useEffect(() => {
let handle = (ev: Window.event) => {
let json = try {
Expand Down
Loading