@captchafox/react 1.3.0 → 1.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -146,20 +146,20 @@ var CaptchaFox = (0, import_react.forwardRef)(
146
146
  if (!containerRef)
147
147
  return;
148
148
  if (firstRendered.current) {
149
- if (!isApiReady()) {
150
- return;
151
- }
152
- renderCaptcha();
153
- }
154
- loadCaptchaScript().then(() => __async(void 0, null, function* () {
155
149
  if (isApiReady()) {
156
- firstRendered.current = true;
157
- yield renderCaptcha();
150
+ renderCaptcha();
158
151
  }
159
- })).catch((err) => {
160
- onError == null ? void 0 : onError(err);
161
- console.error("[CaptchaFox] Could not load script:", err);
162
- });
152
+ } else {
153
+ loadCaptchaScript().then(() => __async(void 0, null, function* () {
154
+ if (isApiReady()) {
155
+ firstRendered.current = true;
156
+ yield renderCaptcha();
157
+ }
158
+ })).catch((err) => {
159
+ onError == null ? void 0 : onError(err);
160
+ console.error("[CaptchaFox] Could not load script:", err);
161
+ });
162
+ }
163
163
  }, [containerRef, sitekey, lang, mode]);
164
164
  return /* @__PURE__ */ import_react.default.createElement("div", { ref: setContainerRef, id: widgetId, className });
165
165
  }
package/dist/index.js CHANGED
@@ -110,20 +110,20 @@ var CaptchaFox = forwardRef(
110
110
  if (!containerRef)
111
111
  return;
112
112
  if (firstRendered.current) {
113
- if (!isApiReady()) {
114
- return;
115
- }
116
- renderCaptcha();
117
- }
118
- loadCaptchaScript().then(() => __async(void 0, null, function* () {
119
113
  if (isApiReady()) {
120
- firstRendered.current = true;
121
- yield renderCaptcha();
114
+ renderCaptcha();
122
115
  }
123
- })).catch((err) => {
124
- onError == null ? void 0 : onError(err);
125
- console.error("[CaptchaFox] Could not load script:", err);
126
- });
116
+ } else {
117
+ loadCaptchaScript().then(() => __async(void 0, null, function* () {
118
+ if (isApiReady()) {
119
+ firstRendered.current = true;
120
+ yield renderCaptcha();
121
+ }
122
+ })).catch((err) => {
123
+ onError == null ? void 0 : onError(err);
124
+ console.error("[CaptchaFox] Could not load script:", err);
125
+ });
126
+ }
127
127
  }, [containerRef, sitekey, lang, mode]);
128
128
  return /* @__PURE__ */ React.createElement("div", { ref: setContainerRef, id: widgetId, className });
129
129
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@captchafox/react",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "main": "./dist/index.cjs",
5
5
  "module": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",