Skip to content

Commit

Permalink
Fix wrong songs being selected in the list when re-entering BSS after…
Browse files Browse the repository at this point in the history
… sorting changed
  • Loading branch information
kinsi55 committed Aug 5, 2021
1 parent c959774 commit 8677cfc
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions UI/SongListController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,16 @@ public void _UpdateSearchedSongsList() {
if(selectedSongView.selectedSong == null) {
selectedSongView.SetSelectedSong(searchedSongsList.FirstOrDefault(), true);
} else if(wasEmpty) {
//selectedSongView.SetSelectedSong(searchedSongsList.FirstOrDefault(x => x.detailsSong.mapId == selectedSongView.selectedSong.detailsSong.mapId), true);
songList.ScrollToCellWithIdx(BSSFlowCoordinator.lastVisibleTableRowIdx, TableView.ScrollPositionType.Beginning, false);
} else {
// Required as otherwise the first cell could be selected eventho its not
if(wasEmpty) {
//selectedSongView.SetSelectedSong(searchedSongsList.FirstOrDefault(x => x.detailsSong.mapId == selectedSongView.selectedSong.detailsSong.mapId), true);
songList.ScrollToCellWithIdx(BSSFlowCoordinator.lastVisibleTableRowIdx, TableView.ScrollPositionType.Beginning, false);
}
// Always un-select in the list to prevent wrong-selections on resorting, etc.
songList.ClearSelection();
}
searchInProgress.gameObject.SetActive(false);
});
}
Expand Down

0 comments on commit 8677cfc

Please sign in to comment.