@openfort/react 1.0.5 → 1.0.6
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/build/components/Pages/BuyProcessing/index.js +10 -4
- package/build/components/Pages/BuyProcessing/index.js.map +1 -1
- package/build/components/Pages/BuySelectProvider/index.js +0 -2
- package/build/components/Pages/BuySelectProvider/index.js.map +1 -1
- package/build/version.d.ts +1 -1
- package/build/version.js +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import { ChainTypeEnum } from '@openfort/openfort-js';
|
|
3
|
-
import { useState, useMemo, useEffect } from 'react';
|
|
3
|
+
import { useState, useMemo, useRef, useEffect } from 'react';
|
|
4
4
|
import Logos from '../../../assets/logos.js';
|
|
5
5
|
import { useEthereumEmbeddedWallet } from '../../../ethereum/hooks/useEthereumEmbeddedWallet.js';
|
|
6
6
|
import { useEthereumWalletAssets } from '../../../ethereum/hooks/useEthereumWalletAssets.js';
|
|
@@ -44,10 +44,16 @@ const BuyProcessing = () => {
|
|
|
44
44
|
return null;
|
|
45
45
|
return numeric;
|
|
46
46
|
}, [buyForm.amount]);
|
|
47
|
-
// Create session and open popup
|
|
47
|
+
// Create session and open popup once wallet is ready
|
|
48
|
+
const sessionStartedRef = useRef(false);
|
|
48
49
|
useEffect(() => {
|
|
50
|
+
if (!address || !chainId)
|
|
51
|
+
return;
|
|
52
|
+
if (sessionStartedRef.current)
|
|
53
|
+
return;
|
|
54
|
+
sessionStartedRef.current = true;
|
|
49
55
|
const createSessionAndOpenPopup = async () => {
|
|
50
|
-
if (!
|
|
56
|
+
if (!fiatAmount || fiatAmount <= 0) {
|
|
51
57
|
setRoute(routes.BUY_SELECT_PROVIDER);
|
|
52
58
|
return;
|
|
53
59
|
}
|
|
@@ -123,7 +129,7 @@ const BuyProcessing = () => {
|
|
|
123
129
|
}
|
|
124
130
|
};
|
|
125
131
|
createSessionAndOpenPopup();
|
|
126
|
-
}, []); //
|
|
132
|
+
}, [address, chainId]); // Run when wallet becomes ready
|
|
127
133
|
// Trigger resize on mount and when state changes
|
|
128
134
|
useEffect(() => {
|
|
129
135
|
triggerResize();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -132,8 +132,6 @@ const BuySelectProvider = () => {
|
|
|
132
132
|
}));
|
|
133
133
|
};
|
|
134
134
|
const handleContinue = () => {
|
|
135
|
-
// Just navigate to the processing screen
|
|
136
|
-
// The processing screen will handle session creation and popup
|
|
137
135
|
setRoute(routes.BUY_PROCESSING);
|
|
138
136
|
};
|
|
139
137
|
const handleBack = () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/build/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const OPENFORT_VERSION = "1.0.
|
|
1
|
+
export declare const OPENFORT_VERSION = "1.0.6";
|
package/build/version.js
CHANGED