diff --git a/artworks.ts b/artworks.ts
index 92f7d06d..a0963599 100644
--- a/artworks.ts
+++ b/artworks.ts
@@ -46,7 +46,7 @@ function displayInitialArtwork(index: number): void {
initialArtworkElement.style.display = "block";
if (loadingIndicator) {
- loadingIndicator.innerHTML = `fetching...`;
+ loadingIndicator.innerHTML = `fetching...
`;
loadingIndicator.style.display = 'none';
}
}
@@ -114,6 +114,7 @@ function loadImageWithProgress(
const xhr = new XMLHttpRequest();
xhr.open('GET', url, true);
xhr.responseType = 'blob';
+ xhr.timeout = 60000; // Set a longer timeout, if necessary
xhr.onprogress = (event: ProgressEvent) => {
if (event.lengthComputable) {
@@ -135,6 +136,10 @@ function loadImageWithProgress(
}
};
+ xhr.ontimeout = function() {
+ console.error("The request for " + url + " timed out.");
+ };
+
xhr.send();
}