Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cc8caa32b1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const [dismissed, setDismissed] = useState(false); | ||
| const [allDone, setAllDone] = useState(false); | ||
| const intervalRef = useRef<ReturnType<typeof setInterval> | null>(null); | ||
| const pollActive = useRef(initialProcessingCount > 0); |
There was a problem hiding this comment.
Restart polling when processing begins after mount
Initialize-and-forget polling via pollActive causes stale status when initialProcessingCount changes from 0 to a positive value while this component stays mounted. Because pollActive.current is only set from the first render and the interval effect does not re-run on that prop change, the bar can fetch once but never continue polling, so users won’t see live progress/completion updates unless they remount the dashboard.
Useful? React with 👍 / 👎.
| }, [allDone]); | ||
|
|
||
| // Nothing to show | ||
| if (dismissed) return null; |
There was a problem hiding this comment.
Clear dismissed state when new jobs appear
After allDone, the timer sets dismissed to true and this early return hides the bar permanently for the rest of the component lifecycle. If a new OCR job starts later without unmounting (for example, another teammate uploads documents while the dashboard remains open), the processing status UI never comes back, so active work is invisible.
Useful? React with 👍 / 👎.
No description provided.