Skip to content

Commit c5c1a28

Browse files
committed
feat: when network connection is restored fetch the images
1 parent a2e69c5 commit c5c1a28

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/LiveDevelopment/BrowserScripts/RemoteFunctions.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3123,6 +3123,15 @@ function RemoteFunctions(config = {}) {
31233123
if (statusChanged && !this._isOffline) {
31243124
this._hideOfflineBanner(true);
31253125
this._offlineBannerDismissed = false;
3126+
3127+
// when user is back online, check if there are already loaded images
3128+
// if not, fetch it
3129+
if (this._currentSearchQuery && (!this.allImages || this.allImages.length === 0)) {
3130+
this.currentPage = 1;
3131+
this.allImages = [];
3132+
this.scrollPosition = 0;
3133+
this._fetchImages(this._currentSearchQuery);
3134+
}
31263135
}
31273136
};
31283137

@@ -3573,7 +3582,7 @@ function RemoteFunctions(config = {}) {
35733582
textElement.textContent = originalText;
35743583
this._hideOfflineBanner(true);
35753584

3576-
if (this._currentSearchQuery) {
3585+
if (this._currentSearchQuery && (!this.allImages || this.allImages.length === 0)) {
35773586
this.currentPage = 1;
35783587
this.allImages = [];
35793588
this.scrollPosition = 0;

0 commit comments

Comments
 (0)