Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Ensure we redraw the latest version from cache

Oliver Günther7e51b3a1ba83
diff --git a/frontend/src/app/components/states/state-cache.service.ts b/frontend/src/app/components/states/state-cache.service.ts
index 1180d09de11..1a0bfd580e7 100644
--- a/frontend/src/app/components/states/state-cache.service.ts
+++ b/frontend/src/app/components/states/state-cache.service.ts
@@ -49,6 +49,13 @@ export abstract class StateCacheService<T> {
state.putValue(state.value, 'Touching the state');
}
+ /**
+ * Get the current value
+ */
+ public current(id:string, fallback?:T):T|undefined {
+ return this.state(id).getValueOr(fallback);
+ }
+
/**
* Update the value due to application changes.
*
diff --git a/frontend/src/app/components/wp-fast-table/wp-fast-table.ts b/frontend/src/app/components/wp-fast-table/wp-fast-table.ts
index e188366d492..8c745b99806 100644
--- a/frontend/src/app/components/wp-fast-table/wp-fast-table.ts
+++ b/frontend/src/app/components/wp-fast-table/wp-fast-table.ts
@@ -77,6 +77,10 @@ export class WorkPackageTable {
this.originalRowIndex = {};
this.originalRows = rows.map((wp:WorkPackageResource, i:number) => {
let wpId = wp.id!;
+
+ // Ensure we get the latest version
+ wp = this.wpCacheService.current(wpId, wp)!;
+
this.originalRowIndex[wpId] = <WorkPackageTableRow>{object: wp, workPackageId: wpId, position: i};
return wpId;
});