@swype-org/react-sdk 0.1.155 → 0.1.156
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 +25 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +25 -10
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3437,6 +3437,7 @@ function WalletPickerScreen({
|
|
|
3437
3437
|
const [hoveredId, setHoveredId] = useState(null);
|
|
3438
3438
|
const [selectedProviderId, setSelectedProviderId] = useState(null);
|
|
3439
3439
|
const [cryptoExpanded, setCryptoExpanded] = useState(false);
|
|
3440
|
+
const [connecting, setConnecting] = useState(false);
|
|
3440
3441
|
const hasPending = pendingConnections != null && pendingConnections.length > 0;
|
|
3441
3442
|
const displayProviders = providers.length > 0 ? providers : [
|
|
3442
3443
|
{ id: "metamask", name: "MetaMask" },
|
|
@@ -3455,11 +3456,25 @@ function WalletPickerScreen({
|
|
|
3455
3456
|
ScreenLayout,
|
|
3456
3457
|
{
|
|
3457
3458
|
footer: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3458
|
-
selectedProvider && /* @__PURE__ */ jsxs(
|
|
3459
|
-
|
|
3460
|
-
|
|
3461
|
-
|
|
3462
|
-
|
|
3459
|
+
selectedProvider && /* @__PURE__ */ jsxs(
|
|
3460
|
+
PrimaryButton,
|
|
3461
|
+
{
|
|
3462
|
+
onClick: async () => {
|
|
3463
|
+
setConnecting(true);
|
|
3464
|
+
try {
|
|
3465
|
+
await onSelectProvider(selectedProvider.id);
|
|
3466
|
+
} finally {
|
|
3467
|
+
setConnecting(false);
|
|
3468
|
+
}
|
|
3469
|
+
},
|
|
3470
|
+
loading: connecting,
|
|
3471
|
+
children: [
|
|
3472
|
+
"Open ",
|
|
3473
|
+
selectedProvider.name,
|
|
3474
|
+
" to Link"
|
|
3475
|
+
]
|
|
3476
|
+
}
|
|
3477
|
+
),
|
|
3463
3478
|
/* @__PURE__ */ jsx(PoweredByFooter, {})
|
|
3464
3479
|
] }),
|
|
3465
3480
|
children: [
|
|
@@ -6516,9 +6531,7 @@ function useProviderHandlers(deps) {
|
|
|
6516
6531
|
useWalletConnector: useWalletConnectorProp,
|
|
6517
6532
|
userAgent: typeof navigator === "undefined" ? void 0 : navigator.userAgent
|
|
6518
6533
|
});
|
|
6519
|
-
if (isMobile) {
|
|
6520
|
-
dispatch({ type: "PAY_STARTED", isSetupRedirect: true });
|
|
6521
|
-
} else {
|
|
6534
|
+
if (!isMobile) {
|
|
6522
6535
|
dispatch({ type: "PAY_STARTED", isSetupRedirect: false });
|
|
6523
6536
|
dispatch({ type: "NAVIGATE", step: "setup-status" });
|
|
6524
6537
|
}
|
|
@@ -6545,8 +6558,8 @@ function useProviderHandlers(deps) {
|
|
|
6545
6558
|
providerId,
|
|
6546
6559
|
isSetup: true
|
|
6547
6560
|
});
|
|
6548
|
-
dispatch({ type: "MOBILE_DEEPLINK_READY", deeplinkUri: session.uri });
|
|
6549
6561
|
triggerDeeplink(session.uri);
|
|
6562
|
+
dispatch({ type: "MOBILE_DEEPLINK_READY", deeplinkUri: session.uri });
|
|
6550
6563
|
} else {
|
|
6551
6564
|
await authExecutor.executeSessionById(session.id);
|
|
6552
6565
|
await reloadAccounts();
|
|
@@ -6558,7 +6571,9 @@ function useProviderHandlers(deps) {
|
|
|
6558
6571
|
dispatch({ type: "PAY_ERROR", error: msg, fallbackStep: "wallet-picker" });
|
|
6559
6572
|
onError?.(msg);
|
|
6560
6573
|
} finally {
|
|
6561
|
-
|
|
6574
|
+
if (!isMobile) {
|
|
6575
|
+
dispatch({ type: "PAY_ENDED" });
|
|
6576
|
+
}
|
|
6562
6577
|
}
|
|
6563
6578
|
}, [
|
|
6564
6579
|
activeCredentialId,
|