Skip to content

Commit

Permalink
fix: add png object in IconaIconData
Browse files Browse the repository at this point in the history
  • Loading branch information
junghyeonsu committed Dec 6, 2023
1 parent 98615b2 commit 567b450
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions figma-plugin/plugin-src/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ export async function exportFromIconaIconData(

if (!value) {
return {
scale: `x${scale}`,
scale: key,
data: "",
};
}
Expand All @@ -153,7 +153,7 @@ export async function exportFromIconaIconData(
const base64String = Base64.fromUint8Array(exportData);

return {
scale: `x${scale}`,
scale: key,
data: base64String,
};
}),
Expand All @@ -163,19 +163,21 @@ export async function exportFromIconaIconData(
if (cur.status === "rejected") console.error(cur.reason);
if (cur.status === "fulfilled") {
const { scale, data } = cur.value as {
scale: string;
scale: keyof IconaIconData["png"];
data: string;
};
acc[scale] = data;
}

return acc;
}, {} as Record<string, string>);
}, {} as Record<keyof IconaIconData["png"], string>);

// name = "icon_name"
result[component.name] = {
...result[component.name],
...pngDatas,
png: {
...pngDatas,
},
};
});

Expand Down

0 comments on commit 567b450

Please sign in to comment.