From 4d5f28aa4c9d9630b601d76ca5a6c73b971b94f4 Mon Sep 17 00:00:00 2001 From: Ilya Laktyushin Date: Wed, 25 Sep 2019 01:19:45 +0300 Subject: [PATCH] Wallet: force English and use case-insensitive comparison in words check --- .../SettingsUI/Sources/Search/SettingsSearchableItems.swift | 2 +- submodules/WalletUI/Sources/WalletWordCheckScreen.swift | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/submodules/SettingsUI/Sources/Search/SettingsSearchableItems.swift b/submodules/SettingsUI/Sources/Search/SettingsSearchableItems.swift index d1679ad377..5470a9fb05 100644 --- a/submodules/SettingsUI/Sources/Search/SettingsSearchableItems.swift +++ b/submodules/SettingsUI/Sources/Search/SettingsSearchableItems.swift @@ -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) diff --git a/submodules/WalletUI/Sources/WalletWordCheckScreen.swift b/submodules/WalletUI/Sources/WalletWordCheckScreen.swift index 7eb8d23de6..dd8f9e11c1 100644 --- a/submodules/WalletUI/Sources/WalletWordCheckScreen.swift +++ b/submodules/WalletUI/Sources/WalletWordCheckScreen.swift @@ -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