Fix admin dashboard crash after removing upcoming events (drop Upcoming card); v2.15.2

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
nmemmertandClaude Sonnet 5.5 committed 2026-10-12 08:21:37 -04:00
1 parent 28fc822132
commit ac1b06f945
4 files changed
+4 -20

No files matched your search

-16
View File
@@ -13,7 +13,6 @@ export interface DashboardData {
lastActivityAt: string | null
}
latestEpisode: { available: boolean; title?: string; episode?: string; season?: string; publishedAt?: string | null; daysAgo?: number | null; stale?: boolean; staleAfterDays?: number }
upcoming: { id: string; kind: string; type: string; title: string; date: string; startTime: string | null }[]
nuggets: { uploadsThisWeek: number; latest: { hostName: string; episodeName: string; uploadedAt: string }[] }
health: {
resendConfigured: boolean
@@ -73,11 +72,6 @@ function formatWhen(value: string | null | undefined) {
return Number.isNaN(d.getTime()) ? '—' : d.toLocaleDateString(undefined, { month: 'short', day: 'numeric', year: 'numeric' })
}
function formatDay(value: string) {
const d = new Date(`${value}T12:00:00`)
return Number.isNaN(d.getTime()) ? value : d.toLocaleDateString(undefined, { weekday: 'short', month: 'short', day: 'numeric' })
}
export function AdminDashboardExtras({ publishedAt, draftUpdatedAt, isDirty, onNavigate, onRequestPublish }: Props) {
const [data, setData] = useState<DashboardData | null>(null)
const [failed, setFailed] = useState(false)
@@ -230,16 +224,6 @@ export function AdminDashboardExtras({ publishedAt, draftUpdatedAt, isDirty, onN
{data.latestEpisode.stale && <div className="admin-dashboard-stale">No new episode in over {data.latestEpisode.staleAfterDays} days.</div>}
</div>
)}
<h3 className="admin-dashboard-activity-heading" style={{ marginTop: '1rem' }}>Upcoming</h3>
{data.upcoming.length === 0 ? <p className="admin-stats-note">Nothing scheduled.</p> : (
<div className="admin-dashboard-feed">
{data.upcoming.map(ev => (
<div key={ev.id} className="admin-dashboard-feed-item admin-dashboard-row">
<span>{ev.title}</span><span className="admin-dashboard-feed-date">{formatDay(ev.date)}{ev.startTime ? ` · ${ev.startTime}` : ''}</span>
</div>
))}
</div>
)}
</div>
</div>