Skip to content

Commit

Permalink
Merge pull request #24 from glmrvn/Dev
Browse files Browse the repository at this point in the history
Fixed loading issues
  • Loading branch information
glmrvn authored Feb 1, 2021
2 parents ddbf363 + 53cee0e commit fa25894
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions code.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,18 @@ if (figma.command == 'dark') {
figma.closePlugin('😶 This document does not have styles');

} else {
const importStyles = await Promise.all(
var importStyles = await Promise.all(
publicStyles.map((styleKey) =>
figma.importStyleByKeyAsync(styleKey)
.catch(() => {})
)
);

if (importStyles[0] == undefined) {
// console.log(importStyles)
var importStyles = [];
}

var allStyles = [...localStyles, ...importStyles]
// console.log(allStyles)

Expand Down Expand Up @@ -256,13 +261,18 @@ if (figma.command == 'light') {
if (typeof publicStyles === 'undefined' && localStyles.length == 0) {
figma.closePlugin('😶 This document does not have styles');
} else {
const importStyles = await Promise.all(
var importStyles = await Promise.all(
publicStyles.map((styleKey) =>
figma.importStyleByKeyAsync(styleKey)
.catch(() => {})
)
);

if (importStyles[0] == undefined) {
// console.log(importStyles)
var importStyles = [];
}

var allStyles = [...localStyles, ...importStyles]
// console.log(allStyles)

Expand Down

0 comments on commit fa25894

Please sign in to comment.