mirror of
https://github.com/keymanapp/keyman.git
synced 2026-09-10 01:27:43 +00:00
fix(web): banner state management after predict-mode toggling
This commit is contained in:
parent
1cf9e65dc5
commit
84cf3fdca5
2 changed files with 11 additions and 1 deletions
|
|
@ -415,9 +415,19 @@ export default class LanguageProcessor extends EventEmitter<LanguageProcessorEve
|
|||
// If it there was one and we've reached this point, we're globally
|
||||
// deactivating, so we're fine.
|
||||
if(this.activeModel) {
|
||||
// If someone toggles predictions on and off without changing the model, it is possible
|
||||
// that the model is already configured!
|
||||
let state: StateChangeEnum = flag ? 'active' : 'inactive';
|
||||
|
||||
// We always signal the 'active' state here, even if 'configured', b/c of an
|
||||
// anti-banner-flicker optimization in the Android app.
|
||||
this._state = state;
|
||||
this.emit('statechange', state);
|
||||
|
||||
if(this.isConfigured) {
|
||||
this._state = 'configured';
|
||||
this.emit('statechange', 'configured');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -296,7 +296,7 @@ export class BannerController {
|
|||
*/
|
||||
selectBanner(state: StateChangeEnum) {
|
||||
// Only display a SuggestionBanner when LanguageProcessor states it is active.
|
||||
if(state == 'active') {
|
||||
if(state == 'active' || state == 'configured') {
|
||||
this.setBanner('suggestion');
|
||||
} else if(state == 'inactive') {
|
||||
if(this.alwaysShow) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue