File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -140,11 +140,11 @@ function Dashboard() {
140140 } , [ dashboardState ] ) ;
141141
142142 // Derived state from discriminated union
143- const isGlobal = dashboardState && ( dashboardState as any ) . isGlobal === true ;
144- const issueQuery = ! isGlobal && dashboardState ? ( dashboardState as any ) . issueQuery || '' : '' ;
145- const milestoneIssues = ! isGlobal && dashboardState ?. state === 'ready' ? ( dashboardState as any ) . milestoneIssues : [ ] ;
143+ const isGlobal = dashboardState ? .isGlobal ;
144+ const issueQuery = ! isGlobal && dashboardState ? dashboardState . issueQuery || '' : '' ;
145+ const milestoneIssues = ! isGlobal && dashboardState ?. state === 'ready' && ! dashboardState . isGlobal ? dashboardState . milestoneIssues : [ ] ;
146146 const activeSessions = dashboardState ?. state === 'ready' ? dashboardState . activeSessions : [ ] ;
147- const recentProjects = isGlobal && dashboardState ?. state === 'ready' ? ( dashboardState as any ) . recentProjects : [ ] ;
147+ const recentProjects = isGlobal && dashboardState ?. state === 'ready' && dashboardState . isGlobal ? dashboardState . recentProjects : [ ] ;
148148
149149 // For global dashboards, create a mixed array of sessions and projects
150150 const mixedItems = isGlobal ? ( ( ) => {
Original file line number Diff line number Diff line change @@ -41,11 +41,13 @@ export type DashboardState = DashboardLoading | DashboardReady | GlobalDashboard
4141
4242export interface DashboardLoading {
4343 readonly state : 'loading' ;
44+ readonly isGlobal : false ;
4445 readonly issueQuery : string ;
4546}
4647
4748export interface DashboardReady {
4849 readonly state : 'ready' ;
50+ readonly isGlobal : false ;
4951 readonly issueQuery : string ;
5052 readonly activeSessions : readonly SessionData [ ] ;
5153 readonly milestoneIssues : readonly IssueData [ ] ;
You can’t perform that action at this time.
0 commit comments