Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Pritish Budhiraja <[email protected]>
  • Loading branch information
seekshiva and PritishBudhiraja authored Aug 26, 2024
1 parent 4d0f957 commit ca29826
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Payments/PreMountLoader.res
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ let sendPromiseData = (promise, key) => {
open Promise
promise
->then(res => resolve(res))
->catch(_err => resolve(JSON.Encode.null))
->catch(_ => resolve(JSON.Encode.null))
->thenResolve(response => {
Utils.messageParentWindow([("response", response), ("data", key->JSON.Encode.string)])
})
Expand Down Expand Up @@ -90,7 +90,7 @@ module PreMountLoaderForPMMElements = {
let messageHandler = (ev: Window.event) => {
let json = ev.data->Utils.safeParse
let dict = json->Utils.getDictFromJson
if dict->Dict.get("sendSavedPaymentMethodsResponse")->Belt.Option.isSome {
if dict->Dict.get("sendSavedPaymentMethodsResponse")->Option.isSome {
savedPaymentMethodsPromise->sendPromiseData("saved_payment_methods")
}
}
Expand Down

0 comments on commit ca29826

Please sign in to comment.