Skip to content

Commit

Permalink
Invalidate queries on logout
Browse files Browse the repository at this point in the history
  • Loading branch information
amanape committed Jan 24, 2025
1 parent c63ef7c commit d88994f
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions frontend/src/hooks/mutation/use-logout.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
import { useMutation } from "@tanstack/react-query";
import { useMutation, useQueryClient } from "@tanstack/react-query";
import OpenHands from "#/api/open-hands";

export const useLogout = () =>
useMutation({
export const useLogout = () => {
const queryClient = useQueryClient();

return useMutation({
mutationFn: OpenHands.logout,
onSuccess: () => {
queryClient.invalidateQueries();
},
});
};

0 comments on commit d88994f

Please sign in to comment.