Improvements on start button

This commit is contained in:
Joao Ramos
2024-09-03 23:23:18 +01:00
parent a7c1ea0409
commit 25e6cb36a9
4 changed files with 65 additions and 37 deletions

View File

@@ -24,7 +24,7 @@ import {
BsPen,
} from "react-icons/bs";
import { toast } from "react-toastify";
import { activeAssignmentFilter } from "@/utils/assignments";
import { futureAssignmentFilter } from "@/utils/assignments";
interface Props {
isOpen: boolean;
@@ -296,11 +296,9 @@ export default function AssignmentView({ isOpen, assignment, onClose }: Props) {
const shouldRenderStart = () => {
if (assignment) {
if (activeAssignmentFilter(assignment)) {
return false;
if (futureAssignmentFilter(assignment)) {
return true;
}
return assignment.results.length === 0;
}
return false;