mirror of
https://github.com/vide/matedroid.git
synced 2026-01-20 00:03:17 +08:00
fix: show 'Model Y/3/S/X' when car name is empty
This commit is contained in:
@@ -20,8 +20,10 @@ data class CarData(
|
||||
@Json(name = "car_details") val carDetails: CarDetails? = null,
|
||||
@Json(name = "car_exterior") val carExterior: CarExterior? = null
|
||||
) {
|
||||
val displayName: String?
|
||||
get() = name
|
||||
val displayName: String
|
||||
get() = name?.takeIf { it.isNotBlank() }
|
||||
?: carDetails?.model?.let { "Model $it" }
|
||||
?: "Tesla"
|
||||
}
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
|
||||
Reference in New Issue
Block a user