Skip to content

Commit

Permalink
Fix React console error about bad setState call in RateSummary
Browse files Browse the repository at this point in the history
  • Loading branch information
haworku committed Feb 1, 2024
1 parent 0a01796 commit 9423fc2
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,12 @@ export const RateSummary = (): React.ReactElement => {
return <GenericErrorPage />
}

//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`)
}

Expand Down

0 comments on commit 9423fc2

Please sign in to comment.