Show favorites only if selected server has favorites (#3729)

This commit is contained in:
Daniel Shokouhi 2023-07-28 10:50:35 -07:00 committed by GitHub
parent 8f7abb4379
commit 447ad5e30a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -122,7 +122,8 @@ class MainVehicleScreen(
setLoading(true)
}.build()
}
val listBuilder = if (favoritesList.isNotEmpty()) {
val serverHasFavorites = favoritesList.any { it.split("-")[0].toIntOrNull() == serverId.value }
val listBuilder = if (serverHasFavorites) {
EntityGridVehicleScreen(
carContext,
serverManager,