Wallet: force English and use case-insensitive comparison in words check

This commit is contained in:
Ilya Laktyushin 2019-09-25 01:19:45 +03:00
parent a5a4467fb1
commit 4d5f28aa4c
2 changed files with 4 additions and 3 deletions

View File

@ -858,7 +858,7 @@ func settingsSearchableItems(context: AccountContext, notificationExceptionsList
})
allItems.append(passport)
if hasWallet {
if true || hasWallet {
let wallet = SettingsSearchableItem(id: .wallet(0), title: "Wallet", alternate: synonyms("Wallet"), icon: .passport, breadcrumbs: [], present: { context, _, present in
openWallet(context: context, push: { c in
present(.push, c)

View File

@ -2116,7 +2116,7 @@ public final class WalletWordCheckScreen: ViewController {
let enteredWords = (strongSelf.displayNode as! WalletWordCheckScreenNode).enteredWords
var isCorrect = true
for i in 0 ..< enteredWords.count {
if enteredWords[i] != wordList[indices[i]] {
if enteredWords[i].lowercased() != wordList[indices[i]] {
isCorrect = false
break
}
@ -2280,6 +2280,7 @@ private final class WordCheckInputNode: ASDisplayNode, UITextFieldDelegate {
self.inputNode.textField.inputAccessoryView = WordCheckInputAccesssoryView(theme: theme, wordList: possibleWordList, wordTapped: { word in
wordTapped?(word)
})
self.inputNode.textField.keyboardType = .asciiCapable
self.inputNode.textField.autocorrectionType = .no
self.inputNode.textField.autocapitalizationType = .none
self.inputNode.textField.spellCheckingType = .no
@ -2338,7 +2339,7 @@ private final class WordCheckInputNode: ASDisplayNode, UITextFieldDelegate {
}
func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool {
let wordList = string.split(separator: " ")
let wordList = string.lowercased().split(separator: " ")
if wordList.count == 24 {
self.pasteWords(wordList.map(String.init))
return false