@hook-sdk/template 0.7.2 → 0.7.3

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
@@ -183,7 +183,8 @@ function usePaywallState() {
183
183
  method: "pix-auto",
184
184
  qrCodePayload: result.qrCodePayload,
185
185
  qrCodeBase64: result.qrCodeBase64,
186
- expiresAt: null
186
+ expiresAt: null,
187
+ paid: false
187
188
  });
188
189
  setOpening(false);
189
190
  return;
@@ -194,7 +195,8 @@ function usePaywallState() {
194
195
  method: "pix-once",
195
196
  qrCodePayload: result.qrCodePayload,
196
197
  qrCodeBase64: result.qrCodeBase64,
197
- expiresAt: result.expiresAt
198
+ expiresAt: result.expiresAt,
199
+ paid: false
198
200
  });
199
201
  setOpening(false);
200
202
  return;
@@ -218,7 +220,7 @@ function usePaywallState() {
218
220
  const subRef = (0, import_react3.useRef)(subscription);
219
221
  subRef.current = subscription;
220
222
  (0, import_react3.useEffect)(() => {
221
- if (!pixPending) return;
223
+ if (!pixPending || pixPending.paid) return;
222
224
  let attempts = 0;
223
225
  const MAX_ATTEMPTS = 60;
224
226
  let cancelled = false;
@@ -230,7 +232,7 @@ function usePaywallState() {
230
232
  if (cancelled) return;
231
233
  const s = subRef.current.status();
232
234
  if (s === "active" || s === "trialing") {
233
- setPixPending(null);
235
+ setPixPending((prev) => prev ? { ...prev, paid: true } : prev);
234
236
  return;
235
237
  }
236
238
  } catch {