Skip to content

Commit

Permalink
Prevent circular reference when setting web resource preview
Browse files Browse the repository at this point in the history
  • Loading branch information
LeoniePeters committed Dec 2, 2024
1 parent 9d363ca commit fe33c5d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/portal/src/plugins/europeana/edm/Aggregation.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ export default class Aggregation extends Base {
for (const wr of (this.webResources || [])) {
wr.forEdmIsShownAt = wr.about === data.edmIsShownAt;
if ([data.edmIsShownBy, data.edmIsShownAt].includes(wr.about) && edmObjectWebResource) {
wr.preview = edmObjectWebResource;
// set the wr preview to a copy of edmObjectWebResource to prevent circular reference
wr.preview = { ...edmObjectWebResource };
}
}
}
Expand Down

0 comments on commit fe33c5d

Please sign in to comment.