diff --git a/apps/dashboard/src/components/data-table/status-report-updates/data-table.tsx b/apps/dashboard/src/components/data-table/status-report-updates/data-table.tsx index 87aece28ae..4876b7cae3 100644 --- a/apps/dashboard/src/components/data-table/status-report-updates/data-table.tsx +++ b/apps/dashboard/src/components/data-table/status-report-updates/data-table.tsx @@ -83,7 +83,9 @@ export function DataTable({ { await createStatusReportUpdateMutation.mutateAsync({ diff --git a/apps/dashboard/src/components/data-table/status-reports/columns.tsx b/apps/dashboard/src/components/data-table/status-reports/columns.tsx index 657edfc3b8..b93c6458c6 100644 --- a/apps/dashboard/src/components/data-table/status-reports/columns.tsx +++ b/apps/dashboard/src/components/data-table/status-reports/columns.tsx @@ -127,7 +127,8 @@ export const columns: ColumnDef[] = [ { id: "startedAt", accessorFn: (row) => - row.updates.sort((a, b) => a.date.getTime() - b.date.getTime())[0]?.date, + row.updates.sort((a, b) => a.date.getTime() - b.date.getTime())[0] + ?.date ?? row.createdAt, header: ({ column }) => ( ), diff --git a/apps/status-page/src/app/(status-page)/[domain]/[locale]/(public)/events/(list)/page.tsx b/apps/status-page/src/app/(status-page)/[domain]/[locale]/(public)/events/(list)/page.tsx index 40bf667533..b11a20cb8a 100644 --- a/apps/status-page/src/app/(status-page)/[domain]/[locale]/(public)/events/(list)/page.tsx +++ b/apps/status-page/src/app/(status-page)/[domain]/[locale]/(public)/events/(list)/page.tsx @@ -63,11 +63,12 @@ export default function Page() { const firstUpdate = updates[updates.length - 1]; const lastUpdate = updates[0]; // NOTE: updates are sorted descending by date - const startedAt = firstUpdate.date; + const startedAt = + firstUpdate?.date ?? report.createdAt ?? new Date(); // HACKY: LEGACY: only resolved via report and not via report update const isReportResolvedOnly = report.status === "resolved" && - lastUpdate.status !== "resolved"; + lastUpdate?.status !== "resolved"; return ( diff --git a/apps/status-page/src/app/(status-page)/[domain]/[locale]/(public)/events/(view)/report/[id]/page.tsx b/apps/status-page/src/app/(status-page)/[domain]/[locale]/(public)/events/(view)/report/[id]/page.tsx index 2d8c00b200..ea702bb9a2 100644 --- a/apps/status-page/src/app/(status-page)/[domain]/[locale]/(public)/events/(view)/report/[id]/page.tsx +++ b/apps/status-page/src/app/(status-page)/[domain]/[locale]/(public)/events/(view)/report/[id]/page.tsx @@ -44,7 +44,7 @@ export default function ReportPage() { // HACKY: LEGACY: only resolved via report and not via report update const isReportResolvedOnly = - report.status === "resolved" && lastUpdate.status !== "resolved"; + report.status === "resolved" && lastUpdate?.status !== "resolved"; return (
@@ -54,7 +54,9 @@ export default function ReportPage() {
- + diff --git a/apps/status-page/src/components/status-page/status-feed.tsx b/apps/status-page/src/components/status-page/status-feed.tsx index 874f1fb427..06378c9e80 100644 --- a/apps/status-page/src/components/status-page/status-feed.tsx +++ b/apps/status-page/src/components/status-page/status-feed.tsx @@ -26,6 +26,7 @@ import { type StatusReport = { id: number; title: string; + createdAt?: Date | null; affected: string[]; updates: { date: Date; @@ -68,7 +69,10 @@ export function StatusFeed({ title: report.title, type: "report" as const, // FIXME: we have a flicker here when the report is updated - startDate: report.updates[report.updates.length - 1]?.date || new Date(), + startDate: + report.updates[report.updates.length - 1]?.date ?? + report.createdAt ?? + new Date(), data: report, })), ...maintenances.map((maintenance) => ({