PrefMgr // Upgrade sanity check for candidate keys.
This commit is contained in:
parent
776f53bee8
commit
f38db788a5
|
@ -296,10 +296,9 @@ public class PrefMgr: PrefMgrProtocol {
|
||||||
@AppProperty(key: UserDef.kCandidateKeys.rawValue, defaultValue: kDefaultCandidateKeys)
|
@AppProperty(key: UserDef.kCandidateKeys.rawValue, defaultValue: kDefaultCandidateKeys)
|
||||||
public var candidateKeys: String {
|
public var candidateKeys: String {
|
||||||
didSet {
|
didSet {
|
||||||
if candidateKeys != candidateKeys.deduplicated {
|
let optimized = candidateKeys.lowercased().deduplicated
|
||||||
candidateKeys = candidateKeys.deduplicated
|
if candidateKeys != optimized { candidateKeys = optimized }
|
||||||
}
|
if CandidateKey.validate(keys: candidateKeys) != nil {
|
||||||
if !(6 ... 9).contains(candidateKeys.count) {
|
|
||||||
candidateKeys = Self.kDefaultCandidateKeys
|
candidateKeys = Self.kDefaultCandidateKeys
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue