From cd0804b89612bfb6a802cfeed704aff9750a95b5 Mon Sep 17 00:00:00 2001 From: dukenv0307 Date: Thu, 14 Sep 2023 09:54:35 +0700 Subject: [PATCH 1/2] fix: 26882 --- src/components/ImageView/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/ImageView/index.js b/src/components/ImageView/index.js index c92bd77382531..5d6d1b609ab38 100644 --- a/src/components/ImageView/index.js +++ b/src/components/ImageView/index.js @@ -225,14 +225,14 @@ function ImageView({isAuthTokenRequired, url, fileName}) { source={{uri: url}} isAuthTokenRequired={isAuthTokenRequired} // Hide image until finished loading to prevent showing preview with wrong dimensions. - style={isLoading ? undefined : [styles.w100, styles.h100]} + style={(isLoading || zoomScale === 0) ? undefined : [styles.w100, styles.h100]} // When Image dimensions are lower than the container boundary(zoomscale <= 1), use `contain` to render the image with natural dimensions. // Both `center` and `contain` keeps the image centered on both x and y axis. resizeMode={zoomScale > 1 ? Image.resizeMode.center : Image.resizeMode.contain} onLoadStart={imageLoadingStart} onLoad={imageLoad} /> - {isLoading && } + {(isLoading || zoomScale === 0) && } ); } From 62266bad2e4bf79cc9a960bdeb40fb4697c970d1 Mon Sep 17 00:00:00 2001 From: dukenv0307 Date: Tue, 19 Sep 2023 13:10:10 +0700 Subject: [PATCH 2/2] fix: lint issue --- src/components/ImageView/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/ImageView/index.js b/src/components/ImageView/index.js index 5d6d1b609ab38..afc5523c17e9d 100644 --- a/src/components/ImageView/index.js +++ b/src/components/ImageView/index.js @@ -225,7 +225,7 @@ function ImageView({isAuthTokenRequired, url, fileName}) { source={{uri: url}} isAuthTokenRequired={isAuthTokenRequired} // Hide image until finished loading to prevent showing preview with wrong dimensions. - style={(isLoading || zoomScale === 0) ? undefined : [styles.w100, styles.h100]} + style={isLoading || zoomScale === 0 ? undefined : [styles.w100, styles.h100]} // When Image dimensions are lower than the container boundary(zoomscale <= 1), use `contain` to render the image with natural dimensions. // Both `center` and `contain` keeps the image centered on both x and y axis. resizeMode={zoomScale > 1 ? Image.resizeMode.center : Image.resizeMode.contain}