Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Cenadros committed Jun 25, 2024
1 parent bb8fca0 commit da4587f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
16 changes: 8 additions & 8 deletions ui-src/parser/creators/createColorsLibrary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ export const createColorsLibrary = async (file: PenpotFile) => {
});

for (const library of libraries) {
for (let i = 0; i < library.fills.length; i++) {
for (let index = 0; index < library.fills.length; index++) {
file.addLibraryColor({
...library.colors[i],
id: library.fills[i].fillColorRefId,
refFile: library.fills[i].fillColorRefFile,
color: library.fills[i].fillColor,
opacity: library.fills[i].fillOpacity,
image: library.fills[i].fillImage,
gradient: library.fills[i].fillColorGradient
...library.colors[index],
id: library.fills[index].fillColorRefId,
refFile: library.fills[index].fillColorRefFile,
color: library.fills[index].fillColor,
opacity: library.fills[index].fillOpacity,
image: library.fills[index].fillImage,
gradient: library.fills[index].fillColorGradient
});

sendMessage({
Expand Down
2 changes: 1 addition & 1 deletion ui-src/parser/creators/createComponentsLibrary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const createComponentsLibrary = async (file: PenpotFile) => {
});

for (const uiComponent of components) {
await createComponentLibrary(file, uiComponent);
createComponentLibrary(file, uiComponent);

sendMessage({
type: 'PROGRESS_PROCESSED_ITEMS',
Expand Down
10 changes: 5 additions & 5 deletions ui-src/parser/parse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,12 @@ const prepareColorLibraries = async (file: PenpotFile, styles: Record<string, Fi
});

for (const [key, fillStyle] of stylesToRegister) {
for (let i = 0; i < fillStyle.fills.length; i++) {
for (let index = 0; index < fillStyle.fills.length; index++) {
const colorId = file.newId();
fillStyle.fills[i].fillColorRefId = colorId;
fillStyle.fills[i].fillColorRefFile = file.getId();
fillStyle.colors[i].id = colorId;
fillStyle.colors[i].refFile = file.getId();
fillStyle.fills[index].fillColorRefId = colorId;
fillStyle.fills[index].fillColorRefFile = file.getId();
fillStyle.colors[index].id = colorId;
fillStyle.colors[index].refFile = file.getId();
}

uiColorLibraries.register(key, fillStyle);
Expand Down

0 comments on commit da4587f

Please sign in to comment.