InputHandler // Remove unnecessary empty state switches.
This commit is contained in:
parent
ce0d6e1fe4
commit
fef6eb5f76
|
@ -145,9 +145,7 @@ extension InputHandler {
|
|||
let text: String = firstCandidate.1
|
||||
delegate.switchState(IMEState.ofCommitting(textToCommit: text))
|
||||
|
||||
if !prefs.associatedPhrasesEnabled {
|
||||
delegate.switchState(IMEState.ofEmpty())
|
||||
} else {
|
||||
if prefs.associatedPhrasesEnabled {
|
||||
let associatedPhrases = generateStateOfAssociates(withPair: .init(keyArray: [reading], value: text))
|
||||
delegate.switchState(associatedPhrases.candidates.isEmpty ? IMEState.ofEmpty() : associatedPhrases)
|
||||
}
|
||||
|
@ -288,9 +286,7 @@ extension InputHandler {
|
|||
let text: String = firstCandidate.1
|
||||
delegate.switchState(IMEState.ofCommitting(textToCommit: text))
|
||||
|
||||
if !prefs.associatedPhrasesEnabled {
|
||||
delegate.switchState(IMEState.ofEmpty())
|
||||
} else {
|
||||
if prefs.associatedPhrasesEnabled {
|
||||
let associatedPhrases = generateStateOfAssociates(withPair: .init(keyArray: [reading], value: text))
|
||||
delegate.switchState(associatedPhrases.candidates.isEmpty ? IMEState.ofEmpty() : associatedPhrases)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue