Skip to content

Commit

Permalink
Use frcWidget property instead of data-attached for attached check
Browse files Browse the repository at this point in the history
  • Loading branch information
merlinfuchs committed Apr 19, 2024
1 parent 37016d8 commit a7aed39
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/sdk/sdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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";
}
}

Expand Down

0 comments on commit a7aed39

Please sign in to comment.