Skip to content

Commit

Permalink
fix: logout validation
Browse files Browse the repository at this point in the history
  • Loading branch information
cswni committed Dec 5, 2024
1 parent 7ab4e28 commit 0128a80
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/components/loginModal/modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const LoginModal: React.FC<LoginModalProps> = ({ open, onClose }) => {
useEffect(() => {
(async () => {
if (w3?.provider) {
// get accounts from provider
// get accounts from provider
const accounts: any = await w3.provider.request({
method: 'eth_accounts'
});
Expand Down Expand Up @@ -80,8 +80,9 @@ export const LoginModal: React.FC<LoginModalProps> = ({ open, onClose }) => {
};

const handleDisconnectWallet = async () => {
console.log('W3', w3.connected)
if (sessionData?.authenticated) await logoutExecute()
if (isConnected) await w3?.logout();
if (w3.connected) await w3?.logout({cleanup: true});
setIsConnected(false);
setView('wallet');
};
Expand Down

0 comments on commit 0128a80

Please sign in to comment.