Updated on 2026-08-14
This commit is contained in:
parent
9700024960
commit
836bf425de
3 changed files with 9 additions and 8 deletions
|
|
@ -80,7 +80,8 @@ internal class JsonToConfig : Converter<PersonalizationJson, PersonalizationConf
|
|||
// copy whole object and then checking tricky places
|
||||
config.cardData = jsonCardData
|
||||
|
||||
config.itsToken = jsonCardData.token_contract_address.isNotEmpty() || jsonCardData.token_symbol.isNotEmpty()
|
||||
config.itsToken = jsonCardData.token_contract_address?.isNotEmpty() ?: false
|
||||
|| jsonCardData.token_symbol?.isNotEmpty() ?: false
|
||||
|
||||
val selectedBlockchain = Helper.listOfBlockchain().firstOrNull { it.value == jsonCardData.blockchain }
|
||||
if (selectedBlockchain == null) {
|
||||
|
|
@ -180,9 +181,9 @@ internal class ConfigToJson : Converter<PersonalizationConfig, PersonalizationJs
|
|||
jsonDto.cardData.token_symbol = config.cardData.token_symbol
|
||||
jsonDto.cardData.token_decimal = config.cardData.token_decimal
|
||||
} else {
|
||||
jsonDto.cardData.token_contract_address = ""
|
||||
jsonDto.cardData.token_symbol = ""
|
||||
jsonDto.cardData.token_decimal = 0
|
||||
jsonDto.cardData.token_contract_address = null
|
||||
jsonDto.cardData.token_symbol = null
|
||||
jsonDto.cardData.token_decimal = null
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -192,9 +192,9 @@ class CardData {
|
|||
var date = ""
|
||||
var batch = ""
|
||||
var blockchain = ""
|
||||
var token_symbol = ""
|
||||
var token_contract_address = ""
|
||||
var token_decimal: Long = 0
|
||||
var token_symbol: String? = null
|
||||
var token_contract_address: String? = null
|
||||
var token_decimal: Long? = null
|
||||
var product_note = false
|
||||
var product_tag = false
|
||||
var product_id_card = false
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ fun PersonalizationJson.toCardConfig(): CardConfig {
|
|||
productMask = productMask,
|
||||
tokenSymbol = this.cardData.token_symbol,
|
||||
tokenContractAddress = this.cardData.token_contract_address,
|
||||
tokenDecimal = this.cardData.token_decimal.toInt(),
|
||||
tokenDecimal = this.cardData.token_decimal?.toInt(),
|
||||
issuerName = this.issuerName,
|
||||
manufactureDateTime = Calendar.getInstance().time,
|
||||
manufacturerSignature = null)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue