Skip to content

Commit

Permalink
fix: prevent circular reference when setting web resource preview (#2497
Browse files Browse the repository at this point in the history
)
  • Loading branch information
LeoniePeters authored Dec 3, 2024
1 parent 127e7f6 commit 92372a8
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 92372a8

Please sign in to comment.