fix: removed useEffect for project detail fetch error (#860)

This commit is contained in:
Dakshesh Jain 2023-04-17 18:38:07 +05:30 committed by GitHub
parent bd0cfef02f
commit 0fa3a8c3e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,5 +1,3 @@
import { useEffect } from "react";
import { useRouter } from "next/router";
import useSWR from "swr";
@ -24,14 +22,6 @@ const useProjectDetails = () => {
: null
);
useEffect(() => {
if (projectDetailsError?.status === 404) {
router.push("/404");
} else if (projectDetailsError) {
router.push("/error");
}
}, [projectDetailsError, router]);
return {
projectDetails,
projectDetailsError,