Skip to content

watchlist-card: restore clearLogo guard to avoid src=undefined #516

@electather

Description

@electather

Part of epic #491. Review nit (B4) on apps/client/src/features/watchlist/components/watchlist-card.tsx:53.

Problem

Old code guarded with Boolean(item.clearLogo) before rendering MediaCardClearLogo. New code drops guard — item.clearLogo is string | undefined, component always renders.

If MediaCardClearLogo passes src straight to <img>, src={undefined} serialises to src="" in DOM → browser fires request to current page URL for every logoless wide card (one broken-image request per Tonight / MoodCluster hero + alternates).

Fix

{isWide && item.clearLogo ? (
  <MediaCardClearLogo src={item.clearLogo} text={item.title} />
) : null}

Or verify MediaCardClearLogo contract handles falsy src safely before keeping the unguarded render.

Acceptance criteria

  • No <img src=""> requests emitted in network panel on /watchlist for logoless cards.
  • Regression test: card without clearLogo does not render MediaCardClearLogo (or component renders safely without <img> request).
  • vp check + vp test pass.

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority: highImportant, schedule soonscope: client@ent-mcp/client packagetype: bugSomething is broken or behaving unexpectedly

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions