File tree Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -368,10 +368,6 @@ interface StatusPageAffectedComponent {
368368}
369369
370370export interface StatusPageIncidentUpdate {
371- /**
372- * Components affected by the update
373- */
374- affected_components : StatusPageAffectedComponent [ ] ;
375371 /**
376372 * Message to display for this update
377373 */
@@ -400,6 +396,10 @@ export interface StatusPageIncidentUpdate {
400396 * ISO Update update time
401397 */
402398 updated_at : string ;
399+ /**
400+ * Components affected by the update
401+ */
402+ affected_components ?: StatusPageAffectedComponent [ ] ;
403403}
404404
405405// See: https://doers.statuspage.io/api/v2/incidents/
Original file line number Diff line number Diff line change @@ -66,8 +66,14 @@ export function useServiceIncidents({
6666 }
6767 if ( componentFilter ) {
6868 filteredIncidents =
69- incidents ?. filter ( inc =>
70- inc . components . some ( comp => componentFilter . includes ( comp . id ) )
69+ incidents ?. filter (
70+ inc =>
71+ // Find incidents that include any of the componentFilter
72+ inc . components . some ( c => componentFilter . includes ( c . id ) ) ||
73+ // Find any incident with an update that includes any of the componentFilter.
74+ inc . incident_updates . some ( update =>
75+ update . affected_components ?. some ( c => componentFilter . includes ( c . code ) )
76+ )
7177 ) ?? null ;
7278 }
7379
You can’t perform that action at this time.
0 commit comments