@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.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
- const modules = stellarWalletsKit.allowAllModules();
30685
- const promises = modules.map(async (module) => {
30686
- const isAvailable = await module.isAvailable();
30687
- return {
30688
- module,
30689
- isAvailable,
30690
- };
30691
- });
30692
- const results = await Promise.all(promises);
30693
- const formattedWallets = results.map((result) => formatStellarWallet(result.module, result.isAvailable));
30694
- setWallets(formattedWallets);
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
  }, []);