mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Dashboards: Move slow dashboard logic to css (#45686)
This commit is contained in:
@@ -7,13 +7,7 @@ import { getTimeSrv, TimeSrv } from 'app/features/dashboard/services/TimeSrv';
|
||||
import { keybindingSrv } from 'app/core/services/keybindingSrv';
|
||||
// Actions
|
||||
import { notifyApp } from 'app/core/actions';
|
||||
import {
|
||||
dashboardInitCompleted,
|
||||
dashboardInitFailed,
|
||||
dashboardInitFetching,
|
||||
dashboardInitServices,
|
||||
dashboardInitSlow,
|
||||
} from './reducers';
|
||||
import { dashboardInitCompleted, dashboardInitFailed, dashboardInitFetching, dashboardInitServices } from './reducers';
|
||||
// Types
|
||||
import { DashboardDTO, DashboardInitPhase, DashboardRoutes, StoreState, ThunkDispatch, ThunkResult } from 'app/types';
|
||||
import { DashboardModel } from './DashboardModel';
|
||||
@@ -110,14 +104,6 @@ export function initDashboard(args: InitDashboardArgs): ThunkResult<void> {
|
||||
// set fetching state
|
||||
dispatch(dashboardInitFetching());
|
||||
|
||||
// Detect slow loading / initializing and set state flag
|
||||
// This is in order to not show loading indication for fast loading dashboards as it creates blinking/flashing
|
||||
setTimeout(() => {
|
||||
if (getState().dashboard.getModel() === null) {
|
||||
dispatch(dashboardInitSlow());
|
||||
}
|
||||
}, 500);
|
||||
|
||||
// fetch dashboard data
|
||||
const dashDTO = await fetchDashboard(args, dispatch, getState);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user