Skip to content

Commit

Permalink
fix: delete DOMRef and parent in header/footer
Browse files Browse the repository at this point in the history
element parent references causes circular import issue when we stringify with json.
  • Loading branch information
maharshivpatel committed Jun 8, 2024
1 parent 353f1d0 commit a60fbfa
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions print_designer/public/js/print_designer/store/ElementStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,8 @@ export const useElementStore = defineStore("ElementStore", {
const footerArray = [...this.Footers];
headerArray.forEach((h) => {
const headerCopy = { ...h };
delete headerCopy.DOMRef;
delete headerCopy.parent;
h.childrens = this.cleanUpElementsForSave(h.childrens, "header") || [];
header.push(headerCopy);
});
Expand All @@ -313,6 +315,8 @@ export const useElementStore = defineStore("ElementStore", {
});
footerArray.forEach((f) => {
const footerCopy = { ...f };
delete footerCopy.DOMRef;
delete footerCopy.parent;
footerCopy.childrens = this.cleanUpElementsForSave(f.childrens, "footer") || [];
footer.push(footerCopy);
});
Expand Down

0 comments on commit a60fbfa

Please sign in to comment.