Skip to content

Commit 3c9e1cc

Browse files
committed
fix: actual image is shown when the image is getting downloaded instead of the previewed image
1 parent 1d7771d commit 3c9e1cc

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/LiveDevelopment/BrowserScripts/RemoteFunctions.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2682,7 +2682,10 @@ function RemoteFunctions(config = {}) {
26822682

26832683
// show original image when hover ends
26842684
thumbDiv.addEventListener('mouseleave', () => {
2685-
this.element.src = this._originalImageSrc;
2685+
// don't reset to original image if we're currently downloading this image
2686+
if (!thumbDiv.classList.contains('downloading')) {
2687+
this.element.src = this._originalImageSrc;
2688+
}
26862689
});
26872690

26882691
// attribution overlay, we show this only in the image ribbon gallery
@@ -2731,10 +2734,12 @@ function RemoteFunctions(config = {}) {
27312734
// show download indicator
27322735
this._showDownloadIndicator(thumbDiv);
27332736

2737+
// set the preview image on main element during download
2738+
const downloadUrl = image.url || image.thumb_url;
2739+
this.element.src = downloadUrl;
2740+
27342741
const filename = this._generateFilename(image);
27352742
const extnName = ".jpg";
2736-
2737-
const downloadUrl = image.url || image.thumb_url;
27382743
this._useImage(downloadUrl, filename, extnName, false, thumbDiv);
27392744
});
27402745

0 commit comments

Comments
 (0)