Skip to content

Commit

Permalink
fix: unnecessary code removal
Browse files Browse the repository at this point in the history
  • Loading branch information
PritishBudhiraja committed Sep 30, 2024
1 parent 7ff13f4 commit 4facd4b
Show file tree
Hide file tree
Showing 9 changed files with 183 additions and 1,143 deletions.
1 change: 0 additions & 1 deletion Hyperswitch-React-Demo-App/src/Payment.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ function Payment() {
? clientSecretQueryParam
: clientSecret,
appearance: {
// theme: "midnight",
labels: "floating",
},
}}
Expand Down
18 changes: 3 additions & 15 deletions src/App.res
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ let make = () => {
}, [logger])

React.useEffect0(() => {
let handleApplePayMessages = (ev: Window.event) => {
let handleMetaDataPostMessage = (ev: Window.event) => {
let json = ev.data->Utils.safeParse
let dict = json->Utils.getDictFromJson

Expand All @@ -43,21 +43,9 @@ let make = () => {
| None => ()
}
}

// if dict->Dict.get("fullScreenIframeMounted")->Option.isSome {
// let metadata = dict->getJsonObjectFromDict("metadata")
// setStateMetadata(_ => metadata)
// let metaDataDict = metadata->JSON.Decode.object->Option.getOr(Dict.make())

// let metadata = dict->getJsonObjectFromDict("metadata")
// if dict->
}
Window.addEventListener("message", handleApplePayMessages)
Some(
() => {
Window.removeEventListener("message", handleApplePayMessages)
},
)
Window.addEventListener("message", handleMetaDataPostMessage)
Some(() => Window.removeEventListener("message", handleMetaDataPostMessage))
})

let renderFullscreen = switch paymentMode {
Expand Down
2 changes: 1 addition & 1 deletion src/Components/PayNowButton.res
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ let make = (~onClickHandler=?, ~label=?) => {
let confirmPayload = sdkHandleConfirmPayment->PaymentBody.confirmPayloadForSDKButton
let buttonText = switch label {
| Some(val) => val
| _ => sdkHandleConfirmPayment.buttonText->Option.getOr(localeString.payNowButton)
| None => sdkHandleConfirmPayment.buttonText->Option.getOr(localeString.payNowButton)
}

let handleMessage = (event: Types.event) => {
Expand Down
Loading

0 comments on commit 4facd4b

Please sign in to comment.