aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/features/workspaces/store.js11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/features/workspaces/store.js b/src/features/workspaces/store.js
index 51a7f3651..07b16ff23 100644
--- a/src/features/workspaces/store.js
+++ b/src/features/workspaces/store.js
@@ -312,17 +312,16 @@ export default class WorkspacesStore extends FeatureStore {
312 312
313 _cleanupInvalidServiceReferences = () => { 313 _cleanupInvalidServiceReferences = () => {
314 const { services } = this.stores; 314 const { services } = this.stores;
315 let invalidServiceReferencesExist = false; 315 const { allServicesRequest } = services;
316 const servicesHaveBeenLoaded = allServicesRequest.wasExecuted && !allServicesRequest.isError;
317 // Loop through all workspaces and remove invalid service ids (locally)
316 this.workspaces.forEach((workspace) => { 318 this.workspaces.forEach((workspace) => {
317 workspace.services.forEach((serviceId) => { 319 workspace.services.forEach((serviceId) => {
318 if (!services.one(serviceId)) { 320 if (servicesHaveBeenLoaded && !services.one(serviceId)) {
319 invalidServiceReferencesExist = true; 321 workspace.services.remove(serviceId);
320 } 322 }
321 }); 323 });
322 }); 324 });
323 if (invalidServiceReferencesExist) {
324 getUserWorkspacesRequest.execute();
325 }
326 }; 325 };
327 326
328 _stopPremiumActionsAndReactions = () => { 327 _stopPremiumActionsAndReactions = () => {