Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
| description: errorMessage, | ||
| ...ErrorToastOptions, | ||
| }); | ||
| onExit(); |
There was a problem hiding this comment.
This made sense when the form was in a modal but it's weird to be redirected back to the homepage for an error IMO.
Greptile SummaryThis PR fixes three bugs in the privacy request submission flow in
Confidence Score: 3/5
Important Files Changed
Last reviewed commit: 7172c01 |
| const errorMessage = typeof error === "string" && error; | ||
| toast({ | ||
| title, | ||
| description: error, | ||
| description: errorMessage, | ||
| ...ErrorToastOptions, | ||
| }); |
There was a problem hiding this comment.
description: false passed to toast
When error is undefined or a non-string (e.g. a Pydantic validation error object), typeof error === "string" && error evaluates to false (not undefined). This means description: false is passed to the toast component, which may render the string "false" as the toast description text — a user-visible bug.
Use a ternary instead so the description is undefined (omitted) when there is no string error:
| const errorMessage = typeof error === "string" && error; | |
| toast({ | |
| title, | |
| description: error, | |
| description: errorMessage, | |
| ...ErrorToastOptions, | |
| }); | |
| setIsSubmitPending(false); | |
| const errorMessage = typeof error === "string" ? error : undefined; | |
| toast({ | |
| title, | |
| description: errorMessage, | |
| ...ErrorToastOptions, | |
| }); |
lucanovera
left a comment
There was a problem hiding this comment.
Followed steps to reproduces and everything worked as expected. Code changes look good. Approved!
Ticket ENG-2867
Description Of Changes
Fixes some bugs with the privacy request flow.
""being submittedSteps to Confirm
Pre-Merge Checklist