Skip to content

Commit

Permalink
fix my mind
Browse files Browse the repository at this point in the history
  • Loading branch information
jordisala1991 committed Jun 27, 2024
1 parent 51b5b72 commit 6c5c50f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 12 deletions.
2 changes: 1 addition & 1 deletion ui-src/parser/creators/createComponentInstance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export const createComponentInstance = (
}

shape.id = id;
shape.shapeRef = originalUiComponent ? uiComponent.mainInstanceId : shapeRef;
shape.shapeRef = originalUiComponent || !shapeRef ? uiComponent.mainInstanceId : shapeRef;
shape.componentFile = file.getId();
shape.componentRoot = isComponentRoot;
shape.componentId = uiComponent.componentId;
Expand Down
4 changes: 2 additions & 2 deletions ui-src/parser/creators/createText.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { symbolFills, symbolStrokes, symbolTouched } from '@ui/parser/creators/s

export const createText = (
file: PenpotFile,
{ type, figmaId, characters, ...shape }: TextShape
{ type, figmaId, characters, componentPropertyReferences, ...shape }: TextShape
) => {
const { id, shapeRef } = parseFigmaId(file, figmaId);

Expand All @@ -17,7 +17,7 @@ export const createText = (
!shape.hidden,
characters,
shape.touched,
shape.componentPropertyReferences
componentPropertyReferences
);

file.createText(shape);
Expand Down
12 changes: 3 additions & 9 deletions ui-src/parser/parseFigmaId.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,11 @@ const parseShapeRef = (file: PenpotFile, figmaId: string | undefined): Uuid | un
return;
}

const id = identifiers.get(figmaRelatedId);

if (id) {
return id;
if (!identifiers.has(figmaRelatedId)) {
identifiers.set(figmaRelatedId, file.newId());
}

const newId = file.newId();

identifiers.set(figmaRelatedId, newId);

return newId;
return identifiers.get(figmaRelatedId);
};

const getRelatedNodeId = (nodeId: string): string | undefined => {
Expand Down

0 comments on commit 6c5c50f

Please sign in to comment.