Skip to content

Commit 841484e

Browse files
Disable lazy loading on authorized images, fixing the image stuck with a loader (#7389)
1 parent b88c5b0 commit 841484e

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

newIDE/app/src/AssetStore/AssetPreviewImage.js

-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ export const AssetPreviewImage = ({
6060
url={previewImageUrl}
6161
alt={assetShortHeader.name}
6262
onLoad={onLoad}
63-
loading={loading}
6463
/>
6564
) : (
6665
<CorsAwareImage

newIDE/app/src/AssetStore/PrivateAssets/AuthorizedAssetImage.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ type Props = {|
1111
onError?: () => void,
1212
onLoad?: (e: any) => void,
1313
hideLoader?: boolean,
14-
loading?: 'lazy',
14+
// We do not handle lazy loading, as we handle the loader ourselves,
15+
// and it will clash with the display: none used to load the image in the background.
1516
|};
1617

1718
const AuthorizedAssetImage = ({
@@ -21,7 +22,6 @@ const AuthorizedAssetImage = ({
2122
onError,
2223
onLoad,
2324
hideLoader,
24-
loading,
2525
}: Props) => {
2626
const [authorizedUrl, setAuthorizedUrl] = React.useState(null);
2727
const [isImageLoaded, setIsImageLoaded] = React.useState(false);
@@ -80,7 +80,6 @@ const AuthorizedAssetImage = ({
8080
<img
8181
alt={alt}
8282
src={authorizedUrl}
83-
loading={loading}
8483
style={{
8584
...style,
8685
// Use display none to load the image in the background, but not

0 commit comments

Comments
 (0)