aboutsummaryrefslogtreecommitdiffstats
path: root/src/features/workspaces/store.js
diff options
context:
space:
mode:
authorLibravatar Dominik Guzei <dominik.guzei@gmail.com>2019-10-04 13:56:46 +0200
committerLibravatar Dominik Guzei <dominik.guzei@gmail.com>2019-10-04 13:56:46 +0200
commitefac27e19d813db32ae097cf1245e16f2d561c12 (patch)
tree6998602a04fdea60a684d77f41a05e36aa15214f /src/features/workspaces/store.js
parentReference electron webview view more defensively (diff)
downloadferdium-app-efac27e19d813db32ae097cf1245e16f2d561c12.tar.gz
ferdium-app-efac27e19d813db32ae097cf1245e16f2d561c12.tar.zst
ferdium-app-efac27e19d813db32ae097cf1245e16f2d561c12.zip
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.
Diffstat (limited to 'src/features/workspaces/store.js')
-rw-r--r--src/features/workspaces/store.js13
1 files changed, 11 insertions, 2 deletions
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 {
141 141
142 filterServicesByActiveWorkspace = (services) => { 142 filterServicesByActiveWorkspace = (services) => {
143 const { activeWorkspace, isFeatureActive } = this; 143 const { activeWorkspace, isFeatureActive } = this;
144 if (isFeatureActive && activeWorkspace) { 144 if (isFeatureActive) {
145 return this.getWorkspaceServices(activeWorkspace); 145 if (activeWorkspace) {
146 return this.getWorkspaceServices(activeWorkspace);
147 }
148 // There is no active workspace yet but we might be still loading them
149 if (!getUserWorkspacesRequest.wasExecuted || getUserWorkspacesRequest.isExecutingFirstTime) {
150 // If so, do not show any services to avoid loading all of them unfiltered
151 // and then having the filter flashing in (which is ugly and slow).
152 console.log('return', []);
153 return [];
154 }
146 } 155 }
147 return services; 156 return services;
148 }; 157 };