Skip to content

Commit 97f201c

Browse files
marcaaronOSBotify
authored andcommitted
Merge pull request #7414 from Expensify/Rory-FixImageResizing
[CP Stg] Resolve getImageSize promise with an object instead of multiple values (cherry picked from commit 87eda2a)
1 parent 219591a commit 97f201c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/components/ImageWithSizeCalculation.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class ImageWithSizeCalculation extends PureComponent {
5656
getImageSize(url) {
5757
return new Promise((resolve, reject) => {
5858
Image.getSize(url, (width, height) => {
59-
resolve(width, height);
59+
resolve({width, height});
6060
}, (error) => {
6161
reject(error);
6262
});
@@ -70,7 +70,7 @@ class ImageWithSizeCalculation extends PureComponent {
7070

7171
this.getImageSizePromise = makeCancellablePromise(this.getImageSize(this.props.url));
7272
this.getImageSizePromise.promise
73-
.then((width, height) => {
73+
.then(({width, height}) => {
7474
if (!width || !height) {
7575
// Image didn't load properly
7676
return;

0 commit comments

Comments
 (0)