Deleted unused useEffect

This commit is contained in:
Keith Stevens
2023-01-11 19:54:55 +09:00
parent 7163555fb0
commit 14f6459424
-7
View File
@@ -1,6 +1,5 @@
import { Container } from "@chakra-ui/react";
import Head from "next/head";
import { useEffect } from "react";
import { LoadingScreen } from "src/components/Loading/LoadingScreen";
import { Task } from "src/components/Tasks/Task";
import { useGenericTaskAPI } from "src/hooks/tasks/useGenericTaskAPI";
@@ -8,12 +7,6 @@ import { useGenericTaskAPI } from "src/hooks/tasks/useGenericTaskAPI";
const RandomTask = () => {
const { tasks, isLoading, trigger, reset } = useGenericTaskAPI("random");
useEffect(() => {
if (tasks.length === 0) {
reset();
}
}, [tasks, reset]);
if (isLoading) {
return <LoadingScreen text="Loading..." />;
}