Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 19 additions & 5 deletions shop.html
Original file line number Diff line number Diff line change
Expand Up @@ -399,10 +399,12 @@ <h1>Shop</h1>
}

this.isFetching = false;
this.hideLoading();
}

// If all fetching failed completely
if (this.allItems.length === 0) {
this.hideLoading();
this.showError(`
<h3>Unable to fetch items from Ko-Fi and Etsy</h3>
<p>The APIs may be unavailable or have CORS restrictions.</p>
Expand Down Expand Up @@ -595,12 +597,24 @@ <h3 class="shop-item-title">
}

showLoading() {
this.shopContainer.innerHTML = `
<div class="loading-overlay">
<i class="fas fa-spinner fa-spin fa-4x"></i>
<p>Loading shop please wait...</p>
</div>
// 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 = `
<i class="fas fa-spinner fa-spin fa-4x"></i>
<p>Loading shop please wait...</p>
`;
document.body.appendChild(overlay);
}

hideLoading() {
const existingOverlay = document.getElementById('global-loading-overlay');
if (existingOverlay) {
existingOverlay.remove();
}
}

showError(message) {
Expand Down