Add missed ;

This commit is contained in:
Max Base
2024-06-29 13:56:13 +03:30
parent d0e3f6be00
commit df09b204ab
7 changed files with 18 additions and 13 deletions

View File

@@ -31,7 +31,8 @@ axios.interceptors.response.use(
},
(error) => {
if (error.response && error.response.status === 401) {
navigate('/login')
navigate('/login');
store.dispatch(setToken(''));
}
return Promise.reject(error);

View File

@@ -9,7 +9,7 @@ const AuthLayout = () => {
<Outlet />
</div>
</>
)
}
);
};
export default AuthLayout
export default AuthLayout;

View File

@@ -73,7 +73,8 @@ const Profile = () => {
queryFn: () => {
return axios.get('/profile');
}
})
});
return (
<>
{!mutation.isPending && (

View File

@@ -28,10 +28,11 @@ const ModalConfigDetails = ({
maxTraffic: number | "unlimited";
traffic: number;
}) => {
const navigate = useNavigate()
const navigate = useNavigate();
const copyToClipboard = async (textToCopy: string) => {
try {
await navigator.clipboard.writeText(textToCopy);
toast.success("متن با موفقیت کپی شد!");
} catch (err) {
toast.error(`Failed to copy: , ${err}`);

View File

@@ -5,13 +5,13 @@ import useAxios from "../../../hooks/useAxios";
import { useQuery } from "@tanstack/react-query";
const Tutorials = () => {
const axios = useAxios()
const axios = useAxios();
const {data,error,isLoading,isFetching} = useQuery({
queryKey:["categoryLearning"],
queryFn: () => {
return axios.get('/home/category/learning')
return axios.get('/home/category/learning');
}
})
});
const [activeTutorial, setActiveTutorial] = useState<number>(1);
return (
<div className="relative w-full h-full flex flex-col px-4 py-4 text-start">

View File

@@ -8,11 +8,13 @@ const isTokenValid = (token: string): boolean => {
return !!token;
} catch (error) {
console.error("Token validation error:", error);
return false;
}
};
export const isAuthenticated = () : boolean => {
const {token} = useSelector((state : RootState) => state.token)
const {token} = useSelector((state : RootState) => state.token);
return isTokenValid(token);
};

View File

@@ -4,4 +4,4 @@ import react from '@vitejs/plugin-react'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
})
});