ENCOA-180: Prevented users from checking their results if not released yet

This commit is contained in:
Tiago Ribeiro
2024-09-05 16:54:45 +01:00
parent c8be2f1255
commit 3b43803b7e
2 changed files with 7 additions and 3 deletions

View File

@@ -277,7 +277,11 @@ const StatsGridItem: React.FC<StatsGridItemProps> = ({
selectedTrainingExams.some((exam) => exam.includes(timestamp)) &&
"border-2 border-slate-600",
)}
onClick={examNumber === undefined ? selectExam : undefined}
onClick={() => {
if (!!assignment && !assignment.released) return;
if (examNumber === undefined) return selectExam();
return;
}}
style={{
...(width !== undefined && {width}),
...(height !== undefined && {height}),