forked from omni/OmniCards
feat: added trimming card name functionality
This commit is contained in:
@@ -50,10 +50,12 @@ fun sendToWatch(context: Context, path: String, message: String, onResult: (Bool
|
||||
}
|
||||
|
||||
fun checkCardData(name: String, value: String): String? {
|
||||
if (name.trim().isEmpty()) {
|
||||
if (name.isEmpty()) {
|
||||
return "Name should not be empty"
|
||||
} else if (value.trim().isEmpty()) {
|
||||
} else if (value.isEmpty()) {
|
||||
return "Code value should not be empty"
|
||||
} else if (name.length > 32) {
|
||||
return "Name must be shorter than 32 symbols"
|
||||
}
|
||||
|
||||
return null
|
||||
|
||||
Reference in New Issue
Block a user