We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f1ea843 commit 2e3d607Copy full SHA for 2e3d607
src/hooks/useLoginLogout.ts
@@ -5,10 +5,12 @@ import { useDisconnect } from 'wagmi';
5
export function useLoginLogout() {
6
const { open } = useAppKit();
7
const { disconnectAsync } = useDisconnect();
8
- const { signOut } = useAuth()
+ const { signOut, isSignedIn } = useAuth()
9
10
const logout = async () => {
11
- signOut()
+ if (isSignedIn) {
12
+ signOut()
13
+ }
14
try {
15
await disconnectAsync();
16
} catch (err) {
0 commit comments