feat: remove abort controller
This commit is contained in:
@@ -15,9 +15,6 @@ const UserRoute: React.FC<UserRouteProps> = ({ children }) => {
|
|||||||
const { notify } = useGlobalInfoStore();
|
const { notify } = useGlobalInfoStore();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const controller = new AbortController();
|
|
||||||
const timeoutId = setTimeout(() => controller.abort(), 10000); // 10 second timeout
|
|
||||||
|
|
||||||
const fetchUser = async () => {
|
const fetchUser = async () => {
|
||||||
try {
|
try {
|
||||||
const { data } = await axios.get('http://localhost:8080/auth/current-user');
|
const { data } = await axios.get('http://localhost:8080/auth/current-user');
|
||||||
@@ -39,10 +36,6 @@ const UserRoute: React.FC<UserRouteProps> = ({ children }) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
fetchUser();
|
fetchUser();
|
||||||
|
|
||||||
return () => {
|
|
||||||
controller.abort();
|
|
||||||
};
|
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const handleRedirect = (errorMessage?: string) => {
|
const handleRedirect = (errorMessage?: string) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user