diff --git a/src/dialogs/ha-voice-command-dialog.html b/src/dialogs/ha-voice-command-dialog.html index 02d64f2750..b9cfa2da7c 100644 --- a/src/dialogs/ha-voice-command-dialog.html +++ b/src/dialogs/ha-voice-command-dialog.html @@ -171,14 +171,18 @@ Polymer({ this.recognition.abort(); var text = this.results.final || this.results.interim; this.results = null; + if (text === '') { + text = ''; + } this.push('_conversation', { who: 'user', text: text, error: true }); }.bind(this); this.recognition.onend = function () { + // Already handled by onerror + if (this.results == null) { + return; + } var text = this.results.final || this.results.interim; this.results = null; - - if (text === '') return; - this.push('_conversation', { who: 'user', text: text }); this.hass.callApi('post', 'conversation/process', { text: text })