diff --git a/common/web/input-processor/src/text/prediction/languageProcessor.ts b/common/web/input-processor/src/text/prediction/languageProcessor.ts index f7c7d5d3e5..9143a2e77e 100644 --- a/common/web/input-processor/src/text/prediction/languageProcessor.ts +++ b/common/web/input-processor/src/text/prediction/languageProcessor.ts @@ -68,7 +68,7 @@ interface LanguageProcessorEventMap { 'tryrevert': () => void, /** - * Is called synchronously as part of suggestion application when successful. + * Is called synchronously once suggestion application is successful and the context has been updated. * * @param outputTarget The `OutputTarget` representation of the context the suggestion was applied to. * @returns diff --git a/common/web/input-processor/src/text/prediction/predictionContext.ts b/common/web/input-processor/src/text/prediction/predictionContext.ts index 9fc5dcd003..aefa60cb10 100644 --- a/common/web/input-processor/src/text/prediction/predictionContext.ts +++ b/common/web/input-processor/src/text/prediction/predictionContext.ts @@ -77,9 +77,8 @@ export default class PredictionContext extends EventEmitter boolean = () => { - return this.currentTarget && langProcessor.state == 'configured'; - } + const validSuggestionState: () => boolean = () => + this.currentTarget && langProcessor.state == 'configured'; this.suggestionApplier = (suggestion) => { if(validSuggestionState()) {