Merge branch 'main' of github.com:joshfe/persian-game

This commit is contained in:
alij
2024-07-03 15:02:04 +03:30
5 changed files with 9 additions and 5 deletions

View File

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

View File

@@ -74,6 +74,7 @@ const Profile = () => {
return axios.get("/profile");
},
});
return (
<>
{!mutation.isPending && (

View File

@@ -41,9 +41,11 @@ const ModalConfigDetails = ({
const navigate = useNavigate();
const dispatch = useDispatch();
const [copyText, setCopyText] = useState<string>("");
const copyToClipboard = async (textToCopy: string) => {
try {
await navigator.clipboard.writeText(textToCopy);
toast.success("متن با موفقیت کپی شد!");
} catch (err) {
try {

View File

@@ -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);
};

View File

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