From 9b325b00b5e40e5261ee1b83d9d9a97ab252b1cb Mon Sep 17 00:00:00 2001 From: Saksham Sharma Date: Fri, 4 Oct 2024 14:33:29 +0530 Subject: [PATCH] fix: sdk pay now redirect fix --- src/orca-loader/Hyper.res | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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)