From 1bde68fc6e5ced992e68a1926176536728a480d0 Mon Sep 17 00:00:00 2001 From: Jatin Sandilya <7681067+jatinsandilya@users.noreply.github.com> Date: Tue, 31 Oct 2023 13:02:56 +0530 Subject: [PATCH] fix: only call `onClose` when passed via props (#340) --- packages/js/src/index.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/js/src/index.ts b/packages/js/src/index.ts index 66c4e1f68..855b97456 100644 --- a/packages/js/src/index.ts +++ b/packages/js/src/index.ts @@ -308,7 +308,9 @@ const createIntegrationBlock = function (self, integration) { rootElement.firstChild.remove(); } this.state = 'close'; - this.#onClose(); + if (this.#onClose) { + this.#onClose(); + } }; renderInitialStage = function (integrationId) {