Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR aims to fix the logout React Query logic by changing from onSettled to onSuccess callback and updating the logout confirmation flow to use mutateAsync instead of mutate. The changes also include modifications to the mobile menu component and a default variant change for the ProfileIndicator component.
Changes:
- Updated logout mutation to use
onSuccessinstead ofonSettledfor better semantic clarity - Modified logout confirmation to use async/await pattern with
mutateAsync - Removed onClick functionality from MobileMenuItem component and changed z-index value
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| client/src/features/auth/mutations/useLogoutMutation.ts | Changed callback from onSettled to onSuccess for logout mutation |
| client/src/components/auth/logoutConfirmation/LogoutConfirmation.tsx | Updated to use mutateAsync with async handler to close modal after logout |
| client/src/components/ui/mobileMenu/MobileMenu.tsx | Removed onClick prop from MobileMenuItem component and changed z-index from z-50 to z-1000 |
| client/src/components/profileIndicator/ProfileIndicator.tsx | Changed default variant from "main" to "private" |
Comments suppressed due to low confidence (1)
client/src/features/auth/mutations/useLogoutMutation.ts:16
- The logout mutation lacks error handling. Other mutations in the codebase (e.g., useLoginMutation.ts, useCreateAppointmentMutation.ts, useRegisterMutation.ts) include onError callbacks to handle failures. Consider adding an onError handler to notify users if logout fails, or to handle the failure gracefully by clearing local state even if the API call fails.
return useMutation({
mutationFn: logoutApi,
onSuccess: () => {
localStorage.removeItem("hadSession");
triggerLogout();
},
});
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
dashaaaa21
approved these changes
Feb 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixed log out react query logic.