diff --git a/src/plugins/dashboard/public/dashboard_listing/index.tsx b/src/plugins/dashboard/public/dashboard_listing/index.tsx index a6996008f9b35..0fa1df0be5220 100644 --- a/src/plugins/dashboard/public/dashboard_listing/index.tsx +++ b/src/plugins/dashboard/public/dashboard_listing/index.tsx @@ -7,10 +7,10 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import React, { Suspense } from 'react'; import { EuiEmptyPrompt, EuiLoadingSpinner } from '@elastic/eui'; +import React, { Suspense } from 'react'; -import { servicesReady } from '../plugin'; +import { untilPluginStartServicesReady } from '../services/kibana_services'; import { DashboardListingProps } from './types'; const ListingTableLoadingIndicator = () => { @@ -20,7 +20,7 @@ const ListingTableLoadingIndicator = () => { const LazyDashboardListing = React.lazy(() => (async () => { const modulePromise = import('./dashboard_listing_table'); - const [module] = await Promise.all([modulePromise, servicesReady]); + const [module] = await Promise.all([modulePromise, untilPluginStartServicesReady()]); return { default: module.DashboardListingTable, diff --git a/src/plugins/dashboard/public/plugin.tsx b/src/plugins/dashboard/public/plugin.tsx index c46dcbc3e4139..b1d60adc84d0f 100644 --- a/src/plugins/dashboard/public/plugin.tsx +++ b/src/plugins/dashboard/public/plugin.tsx @@ -138,7 +138,6 @@ export interface DashboardStart { } export let resolveServicesReady: () => void; -export const servicesReady = new Promise((resolve) => (resolveServicesReady = resolve)); export class DashboardPlugin implements