diff --git a/shop.html b/shop.html index 7f3aed6..d71d8f1 100644 --- a/shop.html +++ b/shop.html @@ -399,10 +399,12 @@

Shop

} this.isFetching = false; + this.hideLoading(); } // If all fetching failed completely if (this.allItems.length === 0) { + this.hideLoading(); this.showError(`

Unable to fetch items from Ko-Fi and Etsy

The APIs may be unavailable or have CORS restrictions.

@@ -595,12 +597,24 @@

} showLoading() { - this.shopContainer.innerHTML = ` -
- -

Loading shop please wait...

-
+ // Remove any existing overlay to prevent duplicates + this.hideLoading(); + + const overlay = document.createElement('div'); + overlay.className = 'loading-overlay'; + overlay.id = 'global-loading-overlay'; + overlay.innerHTML = ` + +

Loading shop please wait...

`; + document.body.appendChild(overlay); + } + + hideLoading() { + const existingOverlay = document.getElementById('global-loading-overlay'); + if (existingOverlay) { + existingOverlay.remove(); + } } showError(message) {