remove hard reload
deploy to danak / build_and_deploy (push) Has been cancelled

This commit is contained in:
2026-07-03 17:16:22 +03:30
parent afc2701580
commit 70e71d7bdb
5 changed files with 77 additions and 25 deletions
+10 -11
View File
@@ -1,10 +1,10 @@
import type { FC, ReactNode } from 'react'
import type { FC, MouseEvent, ReactNode } from 'react'
import { Link } from 'react-router-dom'
import { useQueryClient } from '@tanstack/react-query'
import { clx } from '../helpers/utils'
import { Paths } from '../config/Paths'
// import { useLogout } from '../pages/auth/hooks/useAuthData'
import { removeToken } from '../config/func'
import { removeRefreshToken } from '../config/func'
import { useSessionAuth } from '../config/sessionAuth'
import { appNavigate } from '../config/navigation'
import { useGetAdminMe } from '@/pages/admin/hooks/useAdminData'
import type { PermissionItemType } from '@/pages/admin/types/Types'
@@ -22,14 +22,13 @@ type Props = {
const SideBarItem: FC<Props> = (props: Props) => {
const { data:adminPermissions } = useGetAdminMe();
const queryClient = useQueryClient()
// const logout = useLogout()
const handleLogout = async () => {
// await logout.mutateAsync()
removeToken()
removeRefreshToken()
window.location.href = Paths.auth.login
const handleLogout = (event: MouseEvent<HTMLAnchorElement>) => {
event.preventDefault()
useSessionAuth.getState().clearSession()
queryClient.clear()
appNavigate(Paths.auth.login, { replace: true })
}
const permissions: PermissionItemType[] = adminPermissions?.data?.role?.permissions ?? []
const hasPermission =