@0xsquid/react-hooks 8.0.0-beta.6 → 8.0.0-beta.7
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.esm.js +20 -11
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +20 -11
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.esm.js
CHANGED
|
@@ -30660,17 +30660,26 @@ function useStellarWallets() {
|
|
|
30660
30660
|
const [wallets, setWallets] = useState([]);
|
|
30661
30661
|
useEffect(() => {
|
|
30662
30662
|
const initializeWallets = async () => {
|
|
30663
|
-
|
|
30664
|
-
|
|
30665
|
-
|
|
30666
|
-
|
|
30667
|
-
|
|
30668
|
-
|
|
30669
|
-
|
|
30670
|
-
|
|
30671
|
-
|
|
30672
|
-
|
|
30673
|
-
|
|
30663
|
+
// Only run on client side to avoid SSR issues
|
|
30664
|
+
if (typeof window === 'undefined')
|
|
30665
|
+
return;
|
|
30666
|
+
try {
|
|
30667
|
+
const modules = allowAllModules();
|
|
30668
|
+
const promises = modules.map(async (module) => {
|
|
30669
|
+
const isAvailable = await module.isAvailable();
|
|
30670
|
+
return {
|
|
30671
|
+
module,
|
|
30672
|
+
isAvailable,
|
|
30673
|
+
};
|
|
30674
|
+
});
|
|
30675
|
+
const results = await Promise.all(promises);
|
|
30676
|
+
const formattedWallets = results.map((result) => formatStellarWallet(result.module, result.isAvailable));
|
|
30677
|
+
setWallets(formattedWallets);
|
|
30678
|
+
}
|
|
30679
|
+
catch (error) {
|
|
30680
|
+
console.error('Failed to initialize stellar wallets:', error);
|
|
30681
|
+
setWallets([]);
|
|
30682
|
+
}
|
|
30674
30683
|
};
|
|
30675
30684
|
initializeWallets();
|
|
30676
30685
|
}, []);
|