Skip to content

Commit

Permalink
make sure only exiting props are set
Browse files Browse the repository at this point in the history
  • Loading branch information
odeimaiz committed Nov 14, 2024
1 parent dbe8b8f commit da84743
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ qx.Class.define("osparc.store.Folders", {
__addToCache: function(folderData) {
let folder = this.foldersCached.find(f => f.getFolderId() === folderData["folderId"] && f.getWorkspaceId() === folderData["workspaceId"]);
if (folder) {
const props = Object.keys(qx.util.PropertyUtil.getProperties(osparc.data.model.Folder));
// put
Object.keys(folderData).forEach(key => {
if (key === "createdAt") {
Expand All @@ -180,7 +181,7 @@ qx.Class.define("osparc.store.Folders", {
folder.set("lastModified", new Date(folderData["modifiedAt"]));
} else if (key === "trashedAt") {
folder.set("trashedAt", new Date(folderData["trashedAt"]));
} else {
} else if (props.includes(key)) {
folder.set(key, folderData[key]);
}
});
Expand Down

0 comments on commit da84743

Please sign in to comment.