mirror of
https://github.com/hexastack/hexabot
synced 2025-06-26 18:27:28 +00:00
fix(frontend): apply feedback
This commit is contained in:
parent
20a7fd45a7
commit
cff54eb477
@ -22,7 +22,7 @@ import { useSocket } from "@/websocket/socket-hooks";
|
|||||||
|
|
||||||
import { useFind } from "../crud/useFind";
|
import { useFind } from "../crud/useFind";
|
||||||
import { useApiClient } from "../useApiClient";
|
import { useApiClient } from "../useApiClient";
|
||||||
import { CURRENT_USER_KEY, useAuth, useLogoutRedirection } from "../useAuth";
|
import { useAuth, useLogoutRedirection } from "../useAuth";
|
||||||
import { useToast } from "../useToast";
|
import { useToast } from "../useToast";
|
||||||
import { useTranslate } from "../useTranslate";
|
import { useTranslate } from "../useTranslate";
|
||||||
|
|
||||||
@ -71,12 +71,10 @@ export const useLogout = (
|
|||||||
async mutationFn() {
|
async mutationFn() {
|
||||||
socket?.disconnect();
|
socket?.disconnect();
|
||||||
|
|
||||||
queryClient.clear();
|
|
||||||
|
|
||||||
return await apiClient.logout();
|
return await apiClient.logout();
|
||||||
},
|
},
|
||||||
onSuccess: async () => {
|
onSuccess: async () => {
|
||||||
queryClient.removeQueries([CURRENT_USER_KEY]);
|
queryClient.clear();
|
||||||
postMessage({ event: "logout" });
|
postMessage({ event: "logout" });
|
||||||
await logoutRedirection();
|
await logoutRedirection();
|
||||||
toast.success(t("message.logout_success"));
|
toast.success(t("message.logout_success"));
|
||||||
|
Loading…
Reference in New Issue
Block a user