From 545943d6d87e98028ca0429c86914bc752833430 Mon Sep 17 00:00:00 2001 From: Arush Date: Thu, 30 May 2024 18:23:35 +0530 Subject: [PATCH] fix: fixed klarnaInit undefined in submitCallback --- src/Payments/KlarnaSDK.res | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Payments/KlarnaSDK.res b/src/Payments/KlarnaSDK.res index 22b401a8f..2acaf11dd 100644 --- a/src/Payments/KlarnaSDK.res +++ b/src/Payments/KlarnaSDK.res @@ -34,7 +34,7 @@ let make = (~sessionObj: SessionsType.token) => { Utils.handlePostMessage([("fullscreen", false->JSON.Encode.bool)]) } - let submitCallback = (ev: Window.event) => { + let submitCallback = React.useCallback((ev: Window.event) => { let json = ev.data->JSON.parseExn let confirm = json->Utils.getDictFromJson->ConfirmType.itemToObjMapper @@ -61,7 +61,7 @@ let make = (~sessionObj: SessionsType.token) => { }, ) } - } + }, [status]) useSubmitPaymentData(submitCallback) React.useEffect(() => {