@swype-org/react-sdk 0.1.25 → 0.1.26

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.js CHANGED
@@ -796,7 +796,7 @@ async function deviceHasPasskey(credentialId) {
796
796
  type: "public-key",
797
797
  id: base64ToBytes(credentialId)
798
798
  }],
799
- userVerification: "required",
799
+ userVerification: "discouraged",
800
800
  timeout: 3e4
801
801
  }
802
802
  });
@@ -2267,17 +2267,15 @@ function SwypePayment({
2267
2267
  const loadingDataRef = useRef(false);
2268
2268
  useEffect(() => {
2269
2269
  if (!authenticated) return;
2270
+ if (step === "login") return;
2270
2271
  if (accounts.length > 0 || loadingDataRef.current) return;
2272
+ if (!activeCredentialId) return;
2271
2273
  let cancelled = false;
2272
2274
  loadingDataRef.current = true;
2273
2275
  const load = async () => {
2274
2276
  setLoadingData(true);
2275
2277
  setError(null);
2276
2278
  try {
2277
- if (!activeCredentialId) {
2278
- setStep("register-passkey");
2279
- return;
2280
- }
2281
2279
  const token = await getAccessToken();
2282
2280
  if (!token) throw new Error("Not authenticated");
2283
2281
  const [prov, accts, chn] = await Promise.all([
@@ -2314,7 +2312,7 @@ function SwypePayment({
2314
2312
  cancelled = true;
2315
2313
  loadingDataRef.current = false;
2316
2314
  };
2317
- }, [authenticated, accounts.length, apiBaseUrl, getAccessToken, activeCredentialId]);
2315
+ }, [authenticated, step, accounts.length, apiBaseUrl, getAccessToken, activeCredentialId]);
2318
2316
  useEffect(() => {
2319
2317
  if (!polling.transfer) return;
2320
2318
  if (polling.transfer.status === "COMPLETED") {