@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 CHANGED
@@ -30660,17 +30660,26 @@ function useStellarWallets() {
30660
30660
  const [wallets, setWallets] = useState([]);
30661
30661
  useEffect(() => {
30662
30662
  const initializeWallets = async () => {
30663
- const modules = allowAllModules();
30664
- const promises = modules.map(async (module) => {
30665
- const isAvailable = await module.isAvailable();
30666
- return {
30667
- module,
30668
- isAvailable,
30669
- };
30670
- });
30671
- const results = await Promise.all(promises);
30672
- const formattedWallets = results.map((result) => formatStellarWallet(result.module, result.isAvailable));
30673
- setWallets(formattedWallets);
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
  }, []);