From a7aed39e605163822dc82e747928ba42cad4d377 Mon Sep 17 00:00:00 2001 From: Merlin Date: Fri, 19 Apr 2024 13:29:27 +0200 Subject: [PATCH] Use frcWidget property instead of data-attached for attached check --- src/sdk/sdk.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/sdk/sdk.ts b/src/sdk/sdk.ts index 6caaef7..52c7804 100644 --- a/src/sdk/sdk.ts +++ b/src/sdk/sdk.ts @@ -311,7 +311,7 @@ export class FriendlyCaptchaSDK { const newWidgets: WidgetHandle[] = []; for (let index = 0; index < elements.length; index++) { const hElement = elements[index] as HTMLElement; - if (hElement && !hElement.dataset.attached) { + if (hElement && !(hElement as any ).frcWidget) { const ds = hElement.dataset; const opts: CreateWidgetOptions = { element: hElement, @@ -323,7 +323,6 @@ export class FriendlyCaptchaSDK { startMode: ds.start as StartMode, // Perhaps we should we check for valid values? }; newWidgets.push(this.createWidget(opts)); - hElement.dataset.attached = "1"; } }