@swype-org/react-sdk 0.1.11 → 0.1.12
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 +8 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +8 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2194,19 +2194,22 @@ function SwypePayment({
|
|
|
2194
2194
|
void sign();
|
|
2195
2195
|
}, [mobileFlow, polling.transfer, transferSigning, onError]);
|
|
2196
2196
|
useEffect(() => {
|
|
2197
|
-
if (!mobileFlow
|
|
2197
|
+
if (!mobileFlow) return;
|
|
2198
|
+
const transferIdToResume = pollingTransferIdRef.current ?? transfer?.id;
|
|
2199
|
+
if (!transferIdToResume) return;
|
|
2200
|
+
if (!polling.isPolling) {
|
|
2201
|
+
polling.startPolling(transferIdToResume);
|
|
2202
|
+
}
|
|
2198
2203
|
const handleVisibility = () => {
|
|
2199
2204
|
if (document.visibilityState === "visible") {
|
|
2200
|
-
|
|
2201
|
-
polling.startPolling(pollingTransferIdRef.current);
|
|
2202
|
-
}
|
|
2205
|
+
polling.startPolling(transferIdToResume);
|
|
2203
2206
|
}
|
|
2204
2207
|
};
|
|
2205
2208
|
document.addEventListener("visibilitychange", handleVisibility);
|
|
2206
2209
|
return () => {
|
|
2207
2210
|
document.removeEventListener("visibilitychange", handleVisibility);
|
|
2208
2211
|
};
|
|
2209
|
-
}, [mobileFlow, polling]);
|
|
2212
|
+
}, [mobileFlow, transfer?.id, polling.isPolling, polling.startPolling]);
|
|
2210
2213
|
const pendingSelectSourceAction = authExecutor.pendingSelectSource;
|
|
2211
2214
|
const selectSourceChoices = useMemo(() => {
|
|
2212
2215
|
if (!pendingSelectSourceAction) return [];
|