Skip to content

Commit

Permalink
Updated
Browse files Browse the repository at this point in the history
  • Loading branch information
HashLips committed Jan 26, 2022
1 parent cfabbee commit cdf0c66
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ labels: enhancement

### Motivation

<!-- Why are we doing this? What use cases does it support? What is the expected outcome? -->
<!-- Why are we doing this? What use cases does it support? What is the expected outcome? -->
16 changes: 10 additions & 6 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,13 +177,17 @@ const addAttributes = (_element) => {
};

const loadLayerImg = async (_layer) => {
if (_layer.selectedElement.path.includes("-")) {
throw new Error("layer name can not contain dashes");
try {
if (_layer.selectedElement.path.includes("-")) {
throw new Error("layer name can not contain dashes");
}
return new Promise(async (resolve) => {
const image = await loadImage(`${_layer.selectedElement.path}`);
resolve({ layer: _layer, loadedImage: image });
});
} catch (error) {
console.error("Error loading image:", error);
}
return new Promise(async (resolve) => {
const image = await loadImage(`${_layer.selectedElement.path}`);
resolve({ layer: _layer, loadedImage: image });
});
};

const addText = (_sig, x, y, size) => {
Expand Down

0 comments on commit cdf0c66

Please sign in to comment.