diff --git a/src/orca-loader/Hyper.res b/src/orca-loader/Hyper.res index 692a53196..6941d62a7 100644 --- a/src/orca-loader/Hyper.res +++ b/src/orca-loader/Hyper.res @@ -316,11 +316,13 @@ let make = (publishableKey, options: option, analyticsInfo: optionJSON.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)