@swype-org/react-sdk 0.1.227 → 0.1.228
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 +22 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +22 -7
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1961,7 +1961,8 @@ function createInitialState(config) {
|
|
|
1961
1961
|
guestSessionToken: null,
|
|
1962
1962
|
guestPreauthAccountId: null,
|
|
1963
1963
|
activePublicKey: null,
|
|
1964
|
-
userIntent: null
|
|
1964
|
+
userIntent: null,
|
|
1965
|
+
loginRequested: false
|
|
1965
1966
|
};
|
|
1966
1967
|
}
|
|
1967
1968
|
function paymentReducer(state, action) {
|
|
@@ -1971,7 +1972,8 @@ function paymentReducer(state, action) {
|
|
|
1971
1972
|
return {
|
|
1972
1973
|
...state,
|
|
1973
1974
|
verificationTarget: action.target,
|
|
1974
|
-
error: null
|
|
1975
|
+
error: null,
|
|
1976
|
+
loginRequested: false
|
|
1975
1977
|
};
|
|
1976
1978
|
case "BACK_TO_LOGIN":
|
|
1977
1979
|
return {
|
|
@@ -2213,6 +2215,14 @@ function paymentReducer(state, action) {
|
|
|
2213
2215
|
// ── User intent & error ──────────────────────────────────────
|
|
2214
2216
|
case "SET_USER_INTENT":
|
|
2215
2217
|
return { ...state, userIntent: action.intent };
|
|
2218
|
+
case "REQUEST_LOGIN":
|
|
2219
|
+
return {
|
|
2220
|
+
...state,
|
|
2221
|
+
loginRequested: true,
|
|
2222
|
+
transfer: null,
|
|
2223
|
+
isGuestFlow: false,
|
|
2224
|
+
creatingTransfer: false
|
|
2225
|
+
};
|
|
2216
2226
|
case "SET_ERROR":
|
|
2217
2227
|
return { ...state, error: action.error };
|
|
2218
2228
|
// ── Lifecycle ────────────────────────────────────────────────
|
|
@@ -2232,7 +2242,8 @@ function paymentReducer(state, action) {
|
|
|
2232
2242
|
guestSessionToken: null,
|
|
2233
2243
|
guestPreauthAccountId: null,
|
|
2234
2244
|
activePublicKey: null,
|
|
2235
|
-
userIntent: null
|
|
2245
|
+
userIntent: null,
|
|
2246
|
+
loginRequested: false
|
|
2236
2247
|
};
|
|
2237
2248
|
case "LOGOUT":
|
|
2238
2249
|
return {
|
|
@@ -2325,7 +2336,7 @@ function resolveScreen(state) {
|
|
|
2325
2336
|
if (state.authenticated && !state.activeCredentialId && !state.passkeyConfigLoaded) {
|
|
2326
2337
|
return "loading";
|
|
2327
2338
|
}
|
|
2328
|
-
if (!state.authenticated && !state.verificationTarget && !state.isGuestFlow && (state.isReturningUser || state.guestPreauthRedirect)) {
|
|
2339
|
+
if (!state.authenticated && !state.verificationTarget && !state.isGuestFlow && (state.isReturningUser || state.guestPreauthRedirect || state.loginRequested)) {
|
|
2329
2340
|
return "login";
|
|
2330
2341
|
}
|
|
2331
2342
|
if (!state.authenticated && state.verificationTarget != null) {
|
|
@@ -5897,6 +5908,7 @@ function StepRenderer(props) {
|
|
|
5897
5908
|
isDesktop,
|
|
5898
5909
|
isReturningUser,
|
|
5899
5910
|
guestPreauthRedirect: props.state.guestPreauthAccountId != null,
|
|
5911
|
+
loginRequested: props.state.loginRequested,
|
|
5900
5912
|
userIntent: props.state.userIntent,
|
|
5901
5913
|
selectedAccount: props.selectedAccount,
|
|
5902
5914
|
guestSettingSender: props.guestSettingSender
|
|
@@ -6030,7 +6042,7 @@ function StepRendererContent({
|
|
|
6030
6042
|
useDeeplink: !isDesktop,
|
|
6031
6043
|
error: state.error || (!isDesktop ? pollingError : authExecutorError),
|
|
6032
6044
|
onRetryStatus: !isDesktop ? handlers.onRetryMobileStatus : void 0,
|
|
6033
|
-
onBack: !isDesktop ?
|
|
6045
|
+
onBack: !isDesktop ? handlers.onBackFromOpenWallet : void 0,
|
|
6034
6046
|
onLogout: handlers.onLogout
|
|
6035
6047
|
}
|
|
6036
6048
|
);
|
|
@@ -7416,6 +7428,7 @@ function useGuestTransferHandlers(deps) {
|
|
|
7416
7428
|
if (!isGuestFlow || !guestTransferId || !guestSessionToken || !selectedGuestTokenRef.current) return;
|
|
7417
7429
|
if (executingBridgeRef.current) return;
|
|
7418
7430
|
executingBridgeRef.current = true;
|
|
7431
|
+
dispatch({ type: "PAY_STARTED" });
|
|
7419
7432
|
const execute = async () => {
|
|
7420
7433
|
try {
|
|
7421
7434
|
let signPayload = null;
|
|
@@ -7512,6 +7525,7 @@ function useGuestTransferHandlers(deps) {
|
|
|
7512
7525
|
onError?.(displayMsg);
|
|
7513
7526
|
} finally {
|
|
7514
7527
|
executingBridgeRef.current = false;
|
|
7528
|
+
dispatch({ type: "PAY_ENDED" });
|
|
7515
7529
|
}
|
|
7516
7530
|
};
|
|
7517
7531
|
execute();
|
|
@@ -8516,6 +8530,7 @@ function BlinkPaymentInner({
|
|
|
8516
8530
|
onIncreaseLimit: provider.handleIncreaseLimit,
|
|
8517
8531
|
onConfirmSign: transfer.handleConfirmSign,
|
|
8518
8532
|
onRetryMobileStatus: mobileFlow.handleRetryMobileStatus,
|
|
8533
|
+
onBackFromOpenWallet: () => dispatch({ type: "CLEAR_MOBILE_STATE" }),
|
|
8519
8534
|
onLogout: handleLogout,
|
|
8520
8535
|
onNewPayment: handleNewPayment,
|
|
8521
8536
|
onSetUserIntent: (intent) => dispatch({ type: "SET_USER_INTENT", intent }),
|
|
@@ -8532,8 +8547,8 @@ function BlinkPaymentInner({
|
|
|
8532
8547
|
onSelectAuthorizedToken: provider.handleSelectAuthorizedToken,
|
|
8533
8548
|
onAuthorizeToken: provider.handleAuthorizeToken,
|
|
8534
8549
|
onSelectGuestToken: guestTransfer.handleSelectGuestToken,
|
|
8535
|
-
onLogin: () => dispatch({ type: "
|
|
8536
|
-
onPreauthorize: () => dispatch({ type: "
|
|
8550
|
+
onLogin: () => dispatch({ type: "REQUEST_LOGIN" }),
|
|
8551
|
+
onPreauthorize: () => dispatch({ type: "REQUEST_LOGIN" })
|
|
8537
8552
|
}), [
|
|
8538
8553
|
auth,
|
|
8539
8554
|
passkey,
|