support Classifieds

pull/749/head
greenart7c3 2024-03-18 14:51:50 -03:00
rodzic 84faa7557e
commit 8b3e3e7af8
1 zmienionych plików z 10 dodań i 0 usunięć

Wyświetl plik

@ -381,6 +381,16 @@ open class NewPostViewModel() : ViewModel() {
}
}
wantsProduct = draft.event?.kind() == 30402
title = TextFieldValue(draft.event?.tags()?.filter { it.size > 1 && it[0] == "title" }?.map { it[1] }?.firstOrNull() ?: "")
price = TextFieldValue(draft.event?.tags()?.filter { it.size > 1 && it[0] == "price" }?.map { it[1] }?.firstOrNull() ?: "")
category = TextFieldValue(draft.event?.tags()?.filter { it.size > 1 && it[0] == "t" }?.map { it[1] }?.firstOrNull() ?: "")
locationText = TextFieldValue(draft.event?.tags()?.filter { it.size > 1 && it[0] == "location" }?.map { it[1] }?.firstOrNull() ?: "")
condition = ClassifiedsEvent.CONDITION.entries.firstOrNull {
it.value == draft.event?.tags()?.filter { it.size > 1 && it[0] == "condition" }?.map { it[1] }?.firstOrNull()
} ?: ClassifiedsEvent.CONDITION.USED_LIKE_NEW
message = TextFieldValue(draft.event?.content() ?: "")
urlPreview = findUrlInMessage()
}