From 9423fc2f7d3c9ca4854a1318edd6d967f4a753f9 Mon Sep 17 00:00:00 2001 From: Hana Worku Date: Thu, 1 Feb 2024 09:28:08 -0600 Subject: [PATCH] Fix React console error about bad setState call in RateSummary --- .../pages/SubmissionSummary/RateSummary/RateSummary.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/services/app-web/src/pages/SubmissionSummary/RateSummary/RateSummary.tsx b/services/app-web/src/pages/SubmissionSummary/RateSummary/RateSummary.tsx index fc0855602f..bffa5e076f 100644 --- a/services/app-web/src/pages/SubmissionSummary/RateSummary/RateSummary.tsx +++ b/services/app-web/src/pages/SubmissionSummary/RateSummary/RateSummary.tsx @@ -53,8 +53,12 @@ export const RateSummary = (): React.ReactElement => { return } - //Redirecting a state user to the edit page if rate is unlocked - if (loggedInUser?.role === 'STATE_USER' && rate.status === 'UNLOCKED') { + // Redirecting a state user to the edit page if rate is unlocked + if ( + data && + loggedInUser?.role === 'STATE_USER' && + rate.status === 'UNLOCKED' + ) { navigate(`/rates/${id}/edit`) }