Skip to content

Commit

Permalink
fix: removing getWallets from useConfigure
Browse files Browse the repository at this point in the history
  • Loading branch information
felipecamposfabel committed Dec 7, 2023
1 parent 86963b3 commit 6950d2f
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 50 deletions.
34 changes: 18 additions & 16 deletions lib/commonjs/hooks/useConfigure.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/commonjs/hooks/useConfigure.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 17 additions & 16 deletions lib/module/hooks/useConfigure.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/module/hooks/useConfigure.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 16 additions & 16 deletions src/hooks/useConfigure.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { useCallback, useEffect } from 'react';
import { useColorScheme } from 'react-native';
import { SUBSCRIBER_EVENTS } from '@walletconnect/core';
import { ExplorerCtrl } from '../controllers/ExplorerCtrl';
import { OptionsCtrl } from '../controllers/OptionsCtrl';
// import { ExplorerCtrl } from '../controllers/ExplorerCtrl';
// import { OptionsCtrl } from '../controllers/OptionsCtrl';
import { ConfigCtrl } from '../controllers/ConfigCtrl';
import { ClientCtrl } from '../controllers/ClientCtrl';
import { AccountCtrl } from '../controllers/AccountCtrl';
Expand All @@ -11,7 +11,7 @@ import type { IProviderMetadata, ISessionParams } from '../types/coreTypes';
import { createUniversalProvider } from '../utils/ProviderUtil';
import { StorageUtil } from '../utils/StorageUtil';
import { ThemeCtrl } from '../controllers/ThemeCtrl';
import { ToastCtrl } from '../controllers/ToastCtrl';
// import { ToastCtrl } from '../controllers/ToastCtrl';
import type { ThemeCtrlState } from '../types/controllerTypes';

interface Props {
Expand Down Expand Up @@ -74,19 +74,19 @@ export function useConfigure(config: Props) {
/**
* Fetch wallet list
*/
useEffect(() => {
async function fetchWallets() {
try {
if (!ExplorerCtrl.state.wallets.total) {
await ExplorerCtrl.getWallets();
OptionsCtrl.setIsDataLoaded(true);
}
} catch (error) {
ToastCtrl.openToast('Network error', 'error');
}
}
fetchWallets();
}, []);
// useEffect(() => {
// async function fetchWallets() {
// try {
// if (!ExplorerCtrl.state.wallets.total) {
// await ExplorerCtrl.getWallets();
// OptionsCtrl.setIsDataLoaded(true);
// }
// } catch (error) {
// ToastCtrl.openToast('Network error', 'error');
// }
// }
// fetchWallets();
// }, []);

/**
* Initialize provider
Expand Down

0 comments on commit 6950d2f

Please sign in to comment.