diff --git a/CHANGELOG.unreleased.md b/CHANGELOG.unreleased.md index 928b35010f..d2953d45b0 100644 --- a/CHANGELOG.unreleased.md +++ b/CHANGELOG.unreleased.md @@ -11,14 +11,14 @@ For upgrade instructions, please check the [migration guide](MIGRATIONS.released [Commits](https://github.com/scalableminds/webknossos/compare/21.04.0...HEAD) ### Added -- +- ### Changed - webKnossos is now part of the [image.sc support community](https://forum.image.sc/tag/webknossos). [#5332](https://github.com/scalableminds/webknossos/pull/5332) - Meshes that are imported by the user in the meshes tab are now rendered the same way as generated isosurface meshes. [#5326](https://github.com/scalableminds/webknossos/pull/5326) ### Fixed -- +- Fixed a bug where some values in the project list were displayed incorrectly after pausing/unpausing the project. [#5339](https://github.com/scalableminds/webknossos/pull/5339) ### Removed - diff --git a/frontend/javascripts/admin/project/project_list_view.js b/frontend/javascripts/admin/project/project_list_view.js index 3dd40e9615..6f031e7dd5 100644 --- a/frontend/javascripts/admin/project/project_list_view.js +++ b/frontend/javascripts/admin/project/project_list_view.js @@ -8,7 +8,7 @@ import * as React from "react"; import _ from "lodash"; import { AsyncLink } from "components/async_clickables"; -import type { APIProjectWithAssignments, APIUser } from "types/api_flow_types"; +import type { APIProjectWithAssignments, APIProject, APIUser } from "types/api_flow_types"; import type { OxalisState } from "oxalis/store"; import { enforceActiveUser } from "oxalis/model/accessors/user_accessor"; import { @@ -141,13 +141,22 @@ class ProjectListView extends React.PureComponent { }); }; + mergeProjectWithUpdated = ( + oldProject: APIProjectWithAssignments, + updatedProject: APIProject, + ): APIProjectWithAssignments => + // $FlowIgnore[prop-missing] flow does not understand that merging with type that is superset should produce that type. + ({ ...oldProject, ...updatedProject }); + pauseResumeProject = async ( project: APIProjectWithAssignments, - APICall: string => Promise, + APICall: string => Promise, ) => { const updatedProject = await APICall(project.name); this.setState(prevState => ({ - projects: prevState.projects.map(p => (p.id === project.id ? updatedProject : p)), + projects: prevState.projects.map(p => + p.id === project.id ? this.mergeProjectWithUpdated(p, updatedProject) : p, + ), })); };