@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.js
CHANGED
|
@@ -30681,17 +30681,26 @@ function useStellarWallets() {
|
|
|
30681
30681
|
const [wallets, setWallets] = React.useState([]);
|
|
30682
30682
|
React.useEffect(() => {
|
|
30683
30683
|
const initializeWallets = async () => {
|
|
30684
|
-
|
|
30685
|
-
|
|
30686
|
-
|
|
30687
|
-
|
|
30688
|
-
|
|
30689
|
-
|
|
30690
|
-
|
|
30691
|
-
|
|
30692
|
-
|
|
30693
|
-
|
|
30694
|
-
|
|
30684
|
+
// Only run on client side to avoid SSR issues
|
|
30685
|
+
if (typeof window === 'undefined')
|
|
30686
|
+
return;
|
|
30687
|
+
try {
|
|
30688
|
+
const modules = stellarWalletsKit.allowAllModules();
|
|
30689
|
+
const promises = modules.map(async (module) => {
|
|
30690
|
+
const isAvailable = await module.isAvailable();
|
|
30691
|
+
return {
|
|
30692
|
+
module,
|
|
30693
|
+
isAvailable,
|
|
30694
|
+
};
|
|
30695
|
+
});
|
|
30696
|
+
const results = await Promise.all(promises);
|
|
30697
|
+
const formattedWallets = results.map((result) => formatStellarWallet(result.module, result.isAvailable));
|
|
30698
|
+
setWallets(formattedWallets);
|
|
30699
|
+
}
|
|
30700
|
+
catch (error) {
|
|
30701
|
+
console.error('Failed to initialize stellar wallets:', error);
|
|
30702
|
+
setWallets([]);
|
|
30703
|
+
}
|
|
30695
30704
|
};
|
|
30696
30705
|
initializeWallets();
|
|
30697
30706
|
}, []);
|