hide details until ready
This commit is contained in:
parent
22db9ba04d
commit
5b834f5135
2 changed files with 22 additions and 6 deletions
|
|
@ -740,7 +740,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Artist Hero Section -->
|
<!-- Artist Hero Section -->
|
||||||
<div class="artist-hero-section">
|
<div class="artist-hero-section" id="artist-hero-section">
|
||||||
<div class="artist-hero-content">
|
<div class="artist-hero-content">
|
||||||
<div class="artist-image-container">
|
<div class="artist-image-container">
|
||||||
<img class="artist-image" id="artist-detail-image" src="" alt="Artist Image" />
|
<img class="artist-image" id="artist-detail-image" src="" alt="Artist Image" />
|
||||||
|
|
|
||||||
|
|
@ -14373,13 +14373,13 @@ function initializeArtistDetailPage() {
|
||||||
async function loadArtistDetailData(artistId, artistName) {
|
async function loadArtistDetailData(artistId, artistName) {
|
||||||
console.log(`🔄 Loading artist detail data for: ${artistName} (ID: ${artistId})`);
|
console.log(`🔄 Loading artist detail data for: ${artistName} (ID: ${artistId})`);
|
||||||
|
|
||||||
// Show loading state
|
// Show loading state and hide all content
|
||||||
showArtistDetailLoading(true);
|
showArtistDetailLoading(true);
|
||||||
showArtistDetailError(false);
|
showArtistDetailError(false);
|
||||||
showArtistDetailMain(false);
|
showArtistDetailMain(false);
|
||||||
|
showArtistDetailHero(false);
|
||||||
|
|
||||||
// Update header with artist name
|
// Don't update header until data loads to avoid showing stale data
|
||||||
updateArtistDetailPageHeader(artistName);
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// Call API to get artist discography data
|
// Call API to get artist discography data
|
||||||
|
|
@ -14397,22 +14397,27 @@ async function loadArtistDetailData(artistId, artistName) {
|
||||||
|
|
||||||
console.log(`✅ Loaded artist detail data:`, data);
|
console.log(`✅ Loaded artist detail data:`, data);
|
||||||
|
|
||||||
// Hide loading and show main content
|
// Hide loading and show all content
|
||||||
showArtistDetailLoading(false);
|
showArtistDetailLoading(false);
|
||||||
showArtistDetailMain(true);
|
showArtistDetailMain(true);
|
||||||
|
showArtistDetailHero(true);
|
||||||
|
|
||||||
console.log(`🎨 Main content visibility:`, document.getElementById('artist-detail-main'));
|
console.log(`🎨 Main content visibility:`, document.getElementById('artist-detail-main'));
|
||||||
console.log(`🎨 Albums section:`, document.getElementById('albums-section'));
|
console.log(`🎨 Albums section:`, document.getElementById('albums-section'));
|
||||||
|
|
||||||
|
// Update header with artist name now that data is loaded
|
||||||
|
updateArtistDetailPageHeader(data.artist.name);
|
||||||
|
|
||||||
// Populate the page with data
|
// Populate the page with data
|
||||||
populateArtistDetailPage(data);
|
populateArtistDetailPage(data);
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(`❌ Error loading artist detail data:`, error);
|
console.error(`❌ Error loading artist detail data:`, error);
|
||||||
|
|
||||||
// Show error state
|
// Show error state (keep hero section hidden)
|
||||||
showArtistDetailLoading(false);
|
showArtistDetailLoading(false);
|
||||||
showArtistDetailError(true, error.message);
|
showArtistDetailError(true, error.message);
|
||||||
|
showArtistDetailHero(false);
|
||||||
|
|
||||||
showToast(`Failed to load artist details: ${error.message}`, "error");
|
showToast(`Failed to load artist details: ${error.message}`, "error");
|
||||||
}
|
}
|
||||||
|
|
@ -14931,3 +14936,14 @@ function showArtistDetailMain(show) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function showArtistDetailHero(show) {
|
||||||
|
const heroElement = document.getElementById("artist-hero-section");
|
||||||
|
if (heroElement) {
|
||||||
|
if (show) {
|
||||||
|
heroElement.classList.remove("hidden");
|
||||||
|
} else {
|
||||||
|
heroElement.classList.add("hidden");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue