Skip to content

fix: dashboard crash (React #130) when an account has an unknown platform - #6

Merged
mikipalet merged 1 commit into
mainfrom
fix/unknown-platform-crash
Jul 20, 2026
Merged

fix: dashboard crash (React #130) when an account has an unknown platform#6
mikipalet merged 1 commit into
mainfrom
fix/unknown-platform-crash

Conversation

@mikipalet

Copy link
Copy Markdown
Member

Why

Users with accounts on platforms latewiz doesn't map (WhatsApp, Discord, ads accounts, sms/phone/rcs) hit React error #130 on the dashboard: platformIcons[platform] returned undefined and rendering it as a JSX element crashed the section behind the error boundary.

Fixes #5

What

  • PlatformIcon falls back to a generic globe icon when the platform isn't in the icon map
  • New getPlatformName / getPlatformColor helpers with fallbacks (capitalized name, neutral gray), used everywhere API-provided platform strings are rendered (dashboard, accounts page, account cards)

Verified by rendering PlatformIcon with whatsapp, metaads, discord via renderToString: crashed before, renders the fallback after. tsc --noEmit and lint clean.

🤖 Generated with Claude Code

The API can return account/post platforms outside our hardcoded map
(whatsapp, discord, sms, phone, rcs, and the ads platforms). The
platformIcons lookup then yielded undefined and React threw error #130,
crashing the dashboard behind the error boundary.

PlatformIcon now falls back to a generic globe, and name/color lookups
for API-provided platform strings go through getPlatformName /
getPlatformColor with sensible fallbacks.

Fixes #5

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Jul 20, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
latewiz Ready Ready Preview, Comment Jul 20, 2026 8:20am

Request Review

@mikipalet
mikipalet merged commit 9b07cf6 into main Jul 20, 2026
4 checks passed
@mikipalet
mikipalet deleted the fix/unknown-platform-crash branch July 20, 2026 08:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error @ LateWiz.com

1 participant