From 5b7e78b49fe4ce7e05fafb4e259dfa6a3f71919e Mon Sep 17 00:00:00 2001 From: Pritish Budhiraja Date: Tue, 15 Oct 2024 19:00:37 +0530 Subject: [PATCH] fix: callback fix --- src/orca-loader/LoaderPaymentElement.res | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/orca-loader/LoaderPaymentElement.res b/src/orca-loader/LoaderPaymentElement.res index a09d0e8d..add7383b 100644 --- a/src/orca-loader/LoaderPaymentElement.res +++ b/src/orca-loader/LoaderPaymentElement.res @@ -92,12 +92,14 @@ let make = ( "onEscape", ) | CompleteDoThis => - eventHandlerFunc( - ev => ev.data.completeDoThis, - eventHandler, - CompleteDoThis, - "onCompleteDoThis", - ) + if eventHandler->Option.isSome { + eventHandlerFunc( + ev => ev.data.completeDoThis, + eventHandler, + CompleteDoThis, + "onCompleteDoThis", + ) + } | Change => eventHandlerFunc( ev => ev.data.elementType === componentType,