Skip to content

Commit

Permalink
fix: typo printFonts is object
Browse files Browse the repository at this point in the history
while refactoring the code, by mistake it was changed to an array. This commit fixes it.
  • Loading branch information
maharshivpatel committed Apr 1, 2024
1 parent 4d0f308 commit fbd488e
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions print_designer/public/js/print_designer/store/ElementStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,9 @@ export const useElementStore = defineStore("ElementStore", {
const [cleanedBodyElements, bodyFonts] = body;
const [cleanedHeaderElements, headerFonts] = header || [[], null];
const [cleanedFooterElements, footerFonts] = footer || [[], null];
MainStore.printHeaderFonts = headerFonts;
MainStore.printBodyFonts = bodyFonts;
MainStore.printFooterFonts = footerFonts;

MainStore.currentFonts.length = 0;
MainStore.currentFonts.push(
Expand All @@ -165,6 +168,7 @@ export const useElementStore = defineStore("ElementStore", {
...(footerFonts || {}),
})
);
debugger;
const updatedPage = { ...MainStore.page };
const settingsForSave = {
page: updatedPage,
Expand Down Expand Up @@ -431,12 +435,12 @@ export const useElementStore = defineStore("ElementStore", {
},
cleanUpElementsForSave(elements, type) {
if (this.checkIfPrintFormatIsEmpty(elements, type)) return;
const fontsArray = [];
const fontsObject = {};
const cleanedElements = [];
elements.forEach((container) => {
const cleanedContainer = [];
container.forEach((element) => {
let newElement = this.childrensSave(element.element, fontsArray);
let newElement = this.childrensSave(element.element, fontsObject);
newElement.classes = newElement.classes.filter(
(name) => ["inHeaderFooter", "overlappingHeaderFooter"].indexOf(name) == -1
);
Expand All @@ -451,7 +455,7 @@ export const useElementStore = defineStore("ElementStore", {
});
cleanedElements.push(cleanedContainer);
});
return [cleanedElements, fontsArray];
return [cleanedElements, fontsObject];
},
checkIfPrintFormatIsEmpty(elements, type) {
const MainStore = useMainStore();
Expand Down

0 comments on commit fbd488e

Please sign in to comment.