feat: remove signal

This commit is contained in:
karishmas6
2024-09-25 20:51:48 +05:30
parent 784d4f4e9b
commit 5610d3402b

View File

@@ -20,9 +20,7 @@ const UserRoute: React.FC<UserRouteProps> = ({ children }) => {
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');
signal: controller.signal
});
if (data.ok) { if (data.ok) {
setOk(true); setOk(true);
} else { } else {
@@ -37,7 +35,6 @@ const UserRoute: React.FC<UserRouteProps> = ({ children }) => {
} }
} finally { } finally {
setLoading(false); setLoading(false);
clearTimeout(timeoutId);
} }
}; };
@@ -45,7 +42,6 @@ const UserRoute: React.FC<UserRouteProps> = ({ children }) => {
return () => { return () => {
controller.abort(); controller.abort();
clearTimeout(timeoutId);
}; };
}, []); }, []);