Add some app 131 migration code
This commit is contained in:
parent
8f5ee34610
commit
2caf2024a6
1 changed files with 12 additions and 1 deletions
|
@ -10,5 +10,16 @@ val json = Json {
|
|||
}
|
||||
|
||||
fun generateJson(messages: List<Message>): String {
|
||||
return json.encodeToString(messages)
|
||||
return json.encodeToString(messages.addNewTypeMigration())
|
||||
}
|
||||
|
||||
private fun List<Message>.addNewTypeMigration(): List<Message> {
|
||||
return map {
|
||||
if (!it.types.isNullOrEmpty()) {
|
||||
it.copy(
|
||||
// first app version, which correctly handles other types
|
||||
versionMin = 131,
|
||||
)
|
||||
} else it
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue