fix(discover): genre card from search results did nothing — openGenre reloaded rankings but the view stayed in the Results branch so the update was invisible. Clear the query and return to Idle rankings view, showing 'Top in <genre>'.

This commit is contained in:
avi 2026-10-01 10:44:30 -05:00
commit 31d47f4cb5

View file

@ -315,6 +315,10 @@ class WavlakeViewModel @Inject constructor(
/** Jump the Stations tab filtered to this genre (Discover genre hit). */ /** Jump the Stations tab filtered to this genre (Discover genre hit). */
fun openGenre(genre: String) { fun openGenre(genre: String) {
// Reached from a search-result genre card: the rankings live in the
// Idle branch, so drop the query or the reload would stay invisible.
_searchQuery.value = ""
_searchState.value = WavlakeSearchState.Idle
_rankingsGenre.value = genre _rankingsGenre.value = genre
viewModelScope.launch { viewModelScope.launch {
_rankingsLoading.value = true _rankingsLoading.value = true