fix: move developer error toasts out of render path#1046
fix: move developer error toasts out of render path#1046Venkat-Kolasani wants to merge 2 commits into
Conversation
Move query error toasts in API Keys and Service Accounts pages from render body to useEffect to prevent duplicate stacked toasts. Fixes flexprice#1041
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
WalkthroughTwo developer page components move query error toasts from render-time conditionals into ChangesError toast side-effect migration
Estimated code review effort: 1 (Trivial) | ~3 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@omkar273 could you review when you have a moment? Thanks! |
DiffSniff SummaryNo security issues found in this PR. Reviewed by DiffSniff |
Summary
Fixes duplicate/stacked error toasts on Developers pages by moving
toast.error()from the render path intouseEffectwhen React Query error flags are set.This is batch 1 of #1041 (Developers pages only). The remaining ~24 files with the same render-time toast pattern can follow the identical
useEffectapproach in a follow-up PR if maintainers prefer smaller, incremental merges.Changes
src/pages/developer/developer.tsx— API Keys fetch error toastsrc/pages/developer/ServiceAccounts.tsx— Service Accounts fetch error toastWhy
Calling
toast.error()during render triggers re-render side effects, duplicate toasts, and ReactHotToasterwarnings. This matches existing patterns inSettingsDashboard.tsxandInvoicesWidget.tsx.Test plan
npm run lintpassesnpm run buildpasses (pre-commit hook)Closes #1041
Summary by CodeRabbit