@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.cjs
CHANGED
|
@@ -3440,6 +3440,7 @@ function WalletPickerScreen({
|
|
|
3440
3440
|
const [hoveredId, setHoveredId] = react.useState(null);
|
|
3441
3441
|
const [selectedProviderId, setSelectedProviderId] = react.useState(null);
|
|
3442
3442
|
const [cryptoExpanded, setCryptoExpanded] = react.useState(false);
|
|
3443
|
+
const [connecting, setConnecting] = react.useState(false);
|
|
3443
3444
|
const hasPending = pendingConnections != null && pendingConnections.length > 0;
|
|
3444
3445
|
const displayProviders = providers.length > 0 ? providers : [
|
|
3445
3446
|
{ id: "metamask", name: "MetaMask" },
|
|
@@ -3458,11 +3459,25 @@ function WalletPickerScreen({
|
|
|
3458
3459
|
ScreenLayout,
|
|
3459
3460
|
{
|
|
3460
3461
|
footer: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
3461
|
-
selectedProvider && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3462
|
-
|
|
3463
|
-
|
|
3464
|
-
|
|
3465
|
-
|
|
3462
|
+
selectedProvider && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3463
|
+
PrimaryButton,
|
|
3464
|
+
{
|
|
3465
|
+
onClick: async () => {
|
|
3466
|
+
setConnecting(true);
|
|
3467
|
+
try {
|
|
3468
|
+
await onSelectProvider(selectedProvider.id);
|
|
3469
|
+
} finally {
|
|
3470
|
+
setConnecting(false);
|
|
3471
|
+
}
|
|
3472
|
+
},
|
|
3473
|
+
loading: connecting,
|
|
3474
|
+
children: [
|
|
3475
|
+
"Open ",
|
|
3476
|
+
selectedProvider.name,
|
|
3477
|
+
" to Link"
|
|
3478
|
+
]
|
|
3479
|
+
}
|
|
3480
|
+
),
|
|
3466
3481
|
/* @__PURE__ */ jsxRuntime.jsx(PoweredByFooter, {})
|
|
3467
3482
|
] }),
|
|
3468
3483
|
children: [
|
|
@@ -6519,9 +6534,7 @@ function useProviderHandlers(deps) {
|
|
|
6519
6534
|
useWalletConnector: useWalletConnectorProp,
|
|
6520
6535
|
userAgent: typeof navigator === "undefined" ? void 0 : navigator.userAgent
|
|
6521
6536
|
});
|
|
6522
|
-
if (isMobile) {
|
|
6523
|
-
dispatch({ type: "PAY_STARTED", isSetupRedirect: true });
|
|
6524
|
-
} else {
|
|
6537
|
+
if (!isMobile) {
|
|
6525
6538
|
dispatch({ type: "PAY_STARTED", isSetupRedirect: false });
|
|
6526
6539
|
dispatch({ type: "NAVIGATE", step: "setup-status" });
|
|
6527
6540
|
}
|
|
@@ -6548,8 +6561,8 @@ function useProviderHandlers(deps) {
|
|
|
6548
6561
|
providerId,
|
|
6549
6562
|
isSetup: true
|
|
6550
6563
|
});
|
|
6551
|
-
dispatch({ type: "MOBILE_DEEPLINK_READY", deeplinkUri: session.uri });
|
|
6552
6564
|
triggerDeeplink(session.uri);
|
|
6565
|
+
dispatch({ type: "MOBILE_DEEPLINK_READY", deeplinkUri: session.uri });
|
|
6553
6566
|
} else {
|
|
6554
6567
|
await authExecutor.executeSessionById(session.id);
|
|
6555
6568
|
await reloadAccounts();
|
|
@@ -6561,7 +6574,9 @@ function useProviderHandlers(deps) {
|
|
|
6561
6574
|
dispatch({ type: "PAY_ERROR", error: msg, fallbackStep: "wallet-picker" });
|
|
6562
6575
|
onError?.(msg);
|
|
6563
6576
|
} finally {
|
|
6564
|
-
|
|
6577
|
+
if (!isMobile) {
|
|
6578
|
+
dispatch({ type: "PAY_ENDED" });
|
|
6579
|
+
}
|
|
6565
6580
|
}
|
|
6566
6581
|
}, [
|
|
6567
6582
|
activeCredentialId,
|