From efac27e19d813db32ae097cf1245e16f2d561c12 Mon Sep 17 00:00:00 2001 From: Dominik Guzei Date: Fri, 4 Oct 2019 13:56:46 +0200 Subject: Only load services when workspaces have been loaded This avoids briefly loading and displaying all services (which is ugly and slow) before it has been determined that there actually is an active workspace. --- src/features/workspaces/store.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src/features/workspaces/store.js') diff --git a/src/features/workspaces/store.js b/src/features/workspaces/store.js index 7f41cfc88..a9a0b6eff 100644 --- a/src/features/workspaces/store.js +++ b/src/features/workspaces/store.js @@ -141,8 +141,17 @@ export default class WorkspacesStore extends FeatureStore { filterServicesByActiveWorkspace = (services) => { const { activeWorkspace, isFeatureActive } = this; - if (isFeatureActive && activeWorkspace) { - return this.getWorkspaceServices(activeWorkspace); + if (isFeatureActive) { + if (activeWorkspace) { + return this.getWorkspaceServices(activeWorkspace); + } + // There is no active workspace yet but we might be still loading them + if (!getUserWorkspacesRequest.wasExecuted || getUserWorkspacesRequest.isExecutingFirstTime) { + // If so, do not show any services to avoid loading all of them unfiltered + // and then having the filter flashing in (which is ugly and slow). + console.log('return', []); + return []; + } } return services; }; -- cgit v1.2.3-54-g00ecf