diff --git a/ui/hooks/metamask-notifications/useMetametrics.ts b/ui/hooks/metamask-notifications/useMetametrics.ts index 0f9f1c2f666f..47292c8050a0 100644 --- a/ui/hooks/metamask-notifications/useMetametrics.ts +++ b/ui/hooks/metamask-notifications/useMetametrics.ts @@ -72,6 +72,7 @@ export function useDisableMetametrics(): { } { const dispatch = useDispatch(); const isProfileSyncingEnabled = useSelector(selectIsProfileSyncingEnabled); + const isUserSignedIn = useSelector(selectIsSignedIn); const [loading, setLoading] = useState(false); const [error, setError] = useState(null); @@ -82,7 +83,7 @@ export function useDisableMetametrics(): { setError(null); try { - if (isProfileSyncingEnabled) { + if (isProfileSyncingEnabled && isUserSignedIn) { await dispatch(performSignOut()); } await dispatch(setParticipateInMetaMetrics(false));