diff --git a/ts/gestionnaire.ts b/ts/gestionnaire.ts index e013f17..22830de 100644 --- a/ts/gestionnaire.ts +++ b/ts/gestionnaire.ts @@ -79,6 +79,10 @@ export default class Gestionnaire { public verifierMot(mot: string, skipAnimation: boolean = false): void { mot = this._dictionnaire.nettoyerMot(mot); //console.debug(mot + " => " + (this._dictionnaire.estMotValide(mot) ? "Oui" : "non")); + if (mot.length !== this._motATrouver.length) { + NotificationMessage.ajouterNotification("Le mot proposé est trop court"); + return; + } if (mot[0] !== this._motATrouver[0]) { NotificationMessage.ajouterNotification("Le mot proposé doit commencer par la même lettre que le mot recherché"); return; diff --git a/ts/input.ts b/ts/input.ts index b91c3dc..909298d 100644 --- a/ts/input.ts +++ b/ts/input.ts @@ -76,8 +76,8 @@ export default class Input { private validerMot(): void { if (this._estBloque) return; let mot = this._motSaisi; + this._gestionnaire.verifierMot(mot); if (mot.length === this._longueurMot) { - this._gestionnaire.verifierMot(mot); this._motSaisi = ""; } }