Skip to content

Commit

Permalink
resolve eslint warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
fhildeb committed May 24, 2024
1 parent 1c00234 commit 0a15900
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/contexts/EthereumContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,17 @@ export function EthereumProvider({
isVerified: false,
});

const updateAccountInfo = useCallback(
async (newData: AccountData) => {
setAccountData(newData);
if (typeof window !== 'undefined') {
// Save address and SIWE value to local storage
localStorage.setItem('accountData', JSON.stringify(newData));
}
},
[setAccountData]
);

// Adjust this state value to change the active provider
const [walletTool, setWalletTool] = useState<WalletToolType>('WalletConnect');

Expand All @@ -204,7 +215,7 @@ export function EthereumProvider({
isVerified: false,
});
},
[]
[updateAccountInfo]
);

/**
Expand Down Expand Up @@ -348,17 +359,6 @@ export function EthereumProvider({
}
}, [connectAccount, disconnect, walletTool]);

const updateAccountInfo = useCallback(
async (newData: AccountData) => {
setAccountData(newData);
if (typeof window !== 'undefined') {
// Save address and SIWE value to local storage
localStorage.setItem('accountData', JSON.stringify(newData));
}
},
[setAccountData]
);

// Initialize the provider and listen for account/chain changes
useEffect(() => {
// Load user data from localStorage if available
Expand Down

0 comments on commit 0a15900

Please sign in to comment.