mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-11-30 03:44:18 +00:00
Wallet: force English and use case-insensitive comparison in words check
This commit is contained in:
parent
a5a4467fb1
commit
4d5f28aa4c
@ -858,7 +858,7 @@ func settingsSearchableItems(context: AccountContext, notificationExceptionsList
|
|||||||
})
|
})
|
||||||
allItems.append(passport)
|
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
|
let wallet = SettingsSearchableItem(id: .wallet(0), title: "Wallet", alternate: synonyms("Wallet"), icon: .passport, breadcrumbs: [], present: { context, _, present in
|
||||||
openWallet(context: context, push: { c in
|
openWallet(context: context, push: { c in
|
||||||
present(.push, c)
|
present(.push, c)
|
||||||
|
|||||||
@ -2116,7 +2116,7 @@ public final class WalletWordCheckScreen: ViewController {
|
|||||||
let enteredWords = (strongSelf.displayNode as! WalletWordCheckScreenNode).enteredWords
|
let enteredWords = (strongSelf.displayNode as! WalletWordCheckScreenNode).enteredWords
|
||||||
var isCorrect = true
|
var isCorrect = true
|
||||||
for i in 0 ..< enteredWords.count {
|
for i in 0 ..< enteredWords.count {
|
||||||
if enteredWords[i] != wordList[indices[i]] {
|
if enteredWords[i].lowercased() != wordList[indices[i]] {
|
||||||
isCorrect = false
|
isCorrect = false
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
@ -2280,6 +2280,7 @@ private final class WordCheckInputNode: ASDisplayNode, UITextFieldDelegate {
|
|||||||
self.inputNode.textField.inputAccessoryView = WordCheckInputAccesssoryView(theme: theme, wordList: possibleWordList, wordTapped: { word in
|
self.inputNode.textField.inputAccessoryView = WordCheckInputAccesssoryView(theme: theme, wordList: possibleWordList, wordTapped: { word in
|
||||||
wordTapped?(word)
|
wordTapped?(word)
|
||||||
})
|
})
|
||||||
|
self.inputNode.textField.keyboardType = .asciiCapable
|
||||||
self.inputNode.textField.autocorrectionType = .no
|
self.inputNode.textField.autocorrectionType = .no
|
||||||
self.inputNode.textField.autocapitalizationType = .none
|
self.inputNode.textField.autocapitalizationType = .none
|
||||||
self.inputNode.textField.spellCheckingType = .no
|
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 {
|
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 {
|
if wordList.count == 24 {
|
||||||
self.pasteWords(wordList.map(String.init))
|
self.pasteWords(wordList.map(String.init))
|
||||||
return false
|
return false
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user