diff --git a/web/core/store/module.store.ts b/web/core/store/module.store.ts index f7a99a5c431..23f2af67205 100644 --- a/web/core/store/module.store.ts +++ b/web/core/store/module.store.ts @@ -39,7 +39,7 @@ export interface IModuleStore { updateModuleDistribution: (distributionUpdates: DistributionUpdates, moduleId: string) => void; fetchWorkspaceModules: (workspaceSlug: string) => Promise; fetchModules: (workspaceSlug: string, projectId: string) => Promise; - fetchModulesSlim: (workspaceSlug: string, projectId: string) => Promise + fetchModulesSlim: (workspaceSlug: string, projectId: string) => Promise; fetchArchivedModules: (workspaceSlug: string, projectId: string) => Promise; fetchArchivedModuleDetails: (workspaceSlug: string, projectId: string, moduleId: string) => Promise; fetchModuleDetails: (workspaceSlug: string, projectId: string, moduleId: string) => Promise; @@ -253,6 +253,11 @@ export class ModulesStore implements IModuleStore { response.forEach((module) => { set(this.moduleMap, [module.id], { ...this.moduleMap[module.id], ...module }); }); + // check for all unique project ids and update the fetchedMap + const uniqueProjectIds = new Set(response.map((module) => module.project_id)); + uniqueProjectIds.forEach((projectId) => { + set(this.fetchedMap, projectId, true); + }); }); return response; });