Skip to content

Commit

Permalink
fix: wallet issue fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Pritish Budhiraja committed May 6, 2024
1 parent e0501ea commit d635f13
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/WalletElement.res
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ let make = (~paymentType) => {
let (sessions, setSessions) = React.useState(_ => Dict.make()->JSON.Encode.object)
let (walletOptions, setWalletOptions) = React.useState(_ => [])

let (list, setList) = React.useState(_ => PaymentMethodsRecord.defaultList)
let (paymentMethodListValue, setPaymentMethodListValue) = Recoil.useRecoilState(
PaymentUtils.paymentMethodListValue,
)

let (walletList, _, _) = PaymentUtils.useGetPaymentMethodList(
~paymentMethodListValue=list,
~paymentMethodListValue,
~paymentOptions=[],
~paymentType,
)
Expand All @@ -18,7 +20,7 @@ let make = (~paymentType) => {
| Loaded(paymentlist) =>
let plist = paymentlist->Utils.getDictFromJson->PaymentMethodsRecord.itemToObjMapper
setWalletOptions(_ => walletList)
setList(_ => plist)
setPaymentMethodListValue(_ => plist)
| _ => ()
}
None
Expand Down

0 comments on commit d635f13

Please sign in to comment.