From fb9e72c4d374de2bfffab92123085da87e583bfa Mon Sep 17 00:00:00 2001 From: matushl Date: Sat, 23 Nov 2024 02:06:14 +0100 Subject: [PATCH] resolve #416 - show full title for problems --- src/components/SemesterPicker/SemesterPicker.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/SemesterPicker/SemesterPicker.tsx b/src/components/SemesterPicker/SemesterPicker.tsx index 9175901c..f972c232 100644 --- a/src/components/SemesterPicker/SemesterPicker.tsx +++ b/src/components/SemesterPicker/SemesterPicker.tsx @@ -21,20 +21,20 @@ export const SemesterPicker: FC<{page: 'zadania' | 'vysledky' | 'admin/opravovan useEffect(() => { // setPageTitle using selectedItem variable - let pageTitleToSet = '' if (semester) { const semesterTitle = `${getSemesterYear(semester)} - ${getSemesterName(semester)}` + let pageTitleToSet = semesterTitle if (page === 'admin/opravovanie') { pageTitleToSet = `Opravovanie - ${semester.year}/${semester.season_code === 0 ? 'zima' : 'leto'} (${ semester.school_year })` - } else if (displayWholeSemesterOnResults) { - pageTitleToSet = semesterTitle - } else if (series) { + // ak je page vysledky a zobrazujeme cely semester, tak sa nezobrazuje seria v nazve + // pre seriu sa chceme stale pokusit zobrazit nazov serie + } else if (!(page === 'vysledky' && displayWholeSemesterOnResults) && series) { pageTitleToSet = `${semesterTitle}${series.order ? ` - ${getSeriesName(series)}` : ''}` } + setPageTitle(pageTitleToSet) } - setPageTitle(pageTitleToSet) // `semester` a `series` su nami vytiahnute objekty, tak mozu triggerovat effekt kazdy render. nemalo by vadit }, [displayWholeSemesterOnResults, semester, series, page, setPageTitle])