Skip to content

Commit

Permalink
clean phone number from firs zero
Browse files Browse the repository at this point in the history
  • Loading branch information
soracard committed Oct 27, 2023
1 parent 6cbb73c commit 88bdc6f
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,9 @@ final class SCKYCEnterPhoneViewModel {
}

func onInput(text: String) {
phoneNumber = selectedCountry.dialCode + text
if text.isEmpty {
let cleanText = text.first == "0" ? String(text.dropFirst(1)) : text
phoneNumber = selectedCountry.dialCode + cleanText
if cleanText.isEmpty {
onUpdateUI?(R.string.soraCard.commonNoSpam(preferredLanguages: .currentLocale), false)
} else {
if phoneNumber ~= Self.phoneNumberRegex {
Expand Down

0 comments on commit 88bdc6f

Please sign in to comment.