Skip to content

Commit

Permalink
fix: lint errors in use effect fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
pedropereiradev committed Mar 31, 2024
1 parent cdfe615 commit a1100f4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 3 additions & 1 deletion examples/react-app/src/components/counter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ export default function ContractCounter() {
useLogEvents();

useEffect(() => {
getCount();
if (wallet) {
getCount();
}
}, [wallet]);

return (
Expand Down
7 changes: 6 additions & 1 deletion examples/react-app/src/hooks/useWallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,19 @@ export const useWallet = () => {

const [currentConnector, setCurrentConnector] = useState<ICurrentConnector>({
logo: '',
title: 'Fuel Wallet Demo',
title: 'Fuel Wallet',
});

useEffect(() => {
refetchConnected();
}, [refetchConnected]);

useEffect(() => {
if (!isConnected) {
setCurrentConnector({ logo: '', title: 'Fuel Wallet' });
return;
}

const currentConnector = fuel.currentConnector();

const title = currentConnector?.name ?? 'Fuel Wallet';
Expand Down

0 comments on commit a1100f4

Please sign in to comment.