diff --git a/src/layout/AuthLayout.tsx b/src/layout/AuthLayout.tsx index 8511231..8a720b7 100644 --- a/src/layout/AuthLayout.tsx +++ b/src/layout/AuthLayout.tsx @@ -9,7 +9,7 @@ const AuthLayout = () => { - ) -} + ); +}; -export default AuthLayout \ No newline at end of file +export default AuthLayout; \ No newline at end of file diff --git a/src/pages/profile/index.tsx b/src/pages/profile/index.tsx index 5c64bd8..a76423e 100644 --- a/src/pages/profile/index.tsx +++ b/src/pages/profile/index.tsx @@ -74,6 +74,7 @@ const Profile = () => { return axios.get("/profile"); }, }); + return ( <> {!mutation.isPending && ( diff --git a/src/pages/profile/section/components/ModalConfigDetails.tsx b/src/pages/profile/section/components/ModalConfigDetails.tsx index d64d34c..ba1b6a1 100644 --- a/src/pages/profile/section/components/ModalConfigDetails.tsx +++ b/src/pages/profile/section/components/ModalConfigDetails.tsx @@ -41,9 +41,11 @@ const ModalConfigDetails = ({ const navigate = useNavigate(); const dispatch = useDispatch(); const [copyText, setCopyText] = useState(""); + const copyToClipboard = async (textToCopy: string) => { try { await navigator.clipboard.writeText(textToCopy); + toast.success("متن با موفقیت کپی شد!"); } catch (err) { try { diff --git a/src/utils/auth.ts b/src/utils/auth.ts index 16c513a..940307b 100644 --- a/src/utils/auth.ts +++ b/src/utils/auth.ts @@ -9,12 +9,13 @@ const isTokenValid = (token: string): boolean => { return !!token; } catch (error) { console.error("Token validation error:", error); - toast.error(`Token validation error:${error}`); + toast.error(`توکن کاربر منقضی شده است:${error}`); return false; } }; export const IsAuthenticated = (): boolean => { const { token } = useSelector((state: RootState) => state.token); + return isTokenValid(token); }; diff --git a/vite.config.ts b/vite.config.ts index 5a33944..7ea1e81 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -4,4 +4,4 @@ import react from '@vitejs/plugin-react' // https://vitejs.dev/config/ export default defineConfig({ plugins: [react()], -}) +});