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(() => {