@@ -31,11 +31,12 @@ interface TenantDashboardProps {
3131export const TenantDashboard = ( { database, charts} : TenantDashboardProps ) => {
3232 const graphShardExists = useGraphShardExists ( ) ;
3333
34- // If GraphShardExists capability is true, show dashboard immediately
35- // Otherwise, fall back to reactive behavior (hidden until first chart succeeds)
36- const [ isDashboardHidden , setIsDashboardHidden ] = React . useState < boolean > (
37- graphShardExists !== true ,
38- ) ;
34+ const [ hasSuccessfulChart , setHasSuccessfulChart ] = React . useState < boolean > ( false ) ;
35+
36+ const isDashboardHidden = React . useMemo ( ( ) => {
37+ return graphShardExists !== true && ! hasSuccessfulChart ;
38+ } , [ graphShardExists , hasSuccessfulChart ] ) ;
39+
3940 const [ autoRefreshInterval ] = useAutoRefreshInterval ( ) ;
4041
4142 // Refetch data only if dashboard successfully loaded
@@ -54,7 +55,7 @@ export const TenantDashboard = ({database, charts}: TenantDashboardProps) => {
5455 const handleChartDataStatusChange = ( chartStatus : ChartDataStatus ) => {
5556 // Only use reactive behavior when GraphShardExists capability is not true
5657 if ( graphShardExists !== true && chartStatus === 'success' ) {
57- setIsDashboardHidden ( false ) ;
58+ setHasSuccessfulChart ( true ) ;
5859 }
5960 } ;
6061
0 commit comments