From deae50f44b1a162a8e43f735b984e30efc8755c6 Mon Sep 17 00:00:00 2001 From: omur Date: Sat, 20 Apr 2024 20:16:05 +0200 Subject: [PATCH] fix no rows to show if there is no identifier & spliy_by_id is false --- paramount/client/src/pages/EvaluatePage.tsx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/paramount/client/src/pages/EvaluatePage.tsx b/paramount/client/src/pages/EvaluatePage.tsx index d13c907..b664e1f 100644 --- a/paramount/client/src/pages/EvaluatePage.tsx +++ b/paramount/client/src/pages/EvaluatePage.tsx @@ -12,6 +12,7 @@ import { ACCURATE_EVALUATION, INACCURATE_EVALUATION, NONE_EVALUATION, + SPLIT_BY_ID, } from '@/lib/constants' import EvaluateReviewIndicators from '@/components/EvaluatePage/EvaluateReviewIndicators' import EvaluateReviewCard from '@/components/EvaluatePage/EvaluateReviewCard' @@ -20,6 +21,7 @@ import SaveSessionModal from '@/components/Modals/SaveSessionModal' import 'ag-grid-community/styles/ag-grid.css' import 'ag-grid-community/styles/ag-theme-quartz.css' +import { useNavigate } from 'react-router-dom' export default function EvaluatePage() { const { @@ -34,6 +36,7 @@ export default function EvaluatePage() { updatedEvaluateRecords, setUpdatedEvaluateRecords, } = useContext(AppContext) + const navigator = useNavigate() const gridRef = useRef(null) const [searchKey, setSearchKey] = useState('') @@ -131,8 +134,12 @@ export default function EvaluatePage() { const fetchEvaluateData = async () => { const foundIdentifier = localStorage.getItem('identifier') - if (!foundIdentifier) return - await getEvaluateData(foundIdentifier) + const splitById = config[SPLIT_BY_ID] + if (!foundIdentifier && splitById) { + navigator('/') + return + } + await getEvaluateData(foundIdentifier!) } useEffect(() => {