Skip to content

fix: log out frontend logic#78

Merged
Dmytro-Doronin merged 2 commits intodevelopfrom
fix/logout-frontend-logic
Feb 18, 2026
Merged

fix: log out frontend logic#78
Dmytro-Doronin merged 2 commits intodevelopfrom
fix/logout-frontend-logic

Conversation

@Dmytro-Doronin
Copy link
Contributor

Fixed log out react query logic.

Copilot AI review requested due to automatic review settings February 17, 2026 20:13
@HackYourFutures HackYourFutures temporarily deployed to study-bridge-fix-logout-prlk5e February 17, 2026 20:14 Inactive
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 onSuccess instead of onSettled for 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.

@HackYourFutures HackYourFutures temporarily deployed to study-bridge-fix-logout-prlk5e February 17, 2026 20:22 Inactive
@Dmytro-Doronin Dmytro-Doronin merged commit 433813f into develop Feb 18, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments