Skip to content

Commit

Permalink
Merge pull request #1300 from ever-co/fix/#1295-fake-data-generator-e…
Browse files Browse the repository at this point in the history
…rror

fix: fake data generator error
  • Loading branch information
evereq committed Aug 4, 2020
2 parents 71c8600 + 6c1d579 commit 79a05aa
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
2 changes: 1 addition & 1 deletion packages/admin-web-angular/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ever-platform/admin-web-angular",
"version": "0.3.10",
"version": "0.3.11",
"description": "Ever Admin",
"license": "AGPL-3.0",
"homepage": "https://ever.co",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -414,18 +414,22 @@ export default class FakeDataProducts {
}

private async _getImage() {
const url = images.food[_.random(0, images.food.length - 1)];

const img: HTMLImageElement = await this._getImageMeta(url);

const imgOrientation = this._getImageOrientation(img);

return {
url: img.src,
orientation: imgOrientation,
width: img.width,
height: img.height,
};
try {
const url = images.food[_.random(0, images.food.length - 1)];

const img: HTMLImageElement = await this._getImageMeta(url);

const imgOrientation = this._getImageOrientation(img);

return {
url: img.src,
orientation: imgOrientation,
width: img.width,
height: img.height,
};
} catch (error) {
return error;
}
}

private _getImageOrientation(image: HTMLImageElement) {
Expand Down

0 comments on commit 79a05aa

Please sign in to comment.