Skip empty search results when navigating back from artist detail page

This commit is contained in:
Broque Thomas 2026-04-11 13:54:23 -07:00
parent b3d3c017ed
commit c461f0071d

View file

@ -34383,7 +34383,15 @@ function initializeArtistsPage() {
}
if (detailBackButton) {
detailBackButton.addEventListener('click', () => showArtistsResultsState());
detailBackButton.addEventListener('click', () => {
// If there are no search results (user navigated directly to artist),
// go straight to the main search view instead of showing an empty results page
if (!artistsPageState.searchResults || artistsPageState.searchResults.length === 0) {
showArtistsSearchState();
} else {
showArtistsResultsState();
}
});
}
// Initialize tabs (only need to do this once)