Skip to content

Commit

Permalink
fix: sdk pay now redirect fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Saksham Sharma authored and Saksham Sharma committed Oct 4, 2024
1 parent 7d6c337 commit 9b325b0
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/orca-loader/Hyper.res
Original file line number Diff line number Diff line change
Expand Up @@ -316,11 +316,13 @@ let make = (publishableKey, options: option<JSON.t>, analyticsInfo: option<JSON.
}
postSubmitMessage(dict)

if isSdkButton {
let submitSuccessfulValue = val->JSON.Decode.bool->Option.getOr(false)

if isSdkButton && submitSuccessfulValue {
Window.replaceRootHref(returnUrl)
} else if val->JSON.Decode.bool->Option.getOr(false) && redirect === "always" {
} else if submitSuccessfulValue && redirect === "always" {
Window.replaceRootHref(returnUrl)
} else if !(val->JSON.Decode.bool->Option.getOr(false)) {
} else if !submitSuccessfulValue {
resolve1(json)
} else {
resolve1(data)
Expand Down

0 comments on commit 9b325b0

Please sign in to comment.