From a41978f647ef4244910e62e3849bf6eb686a9a80 Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Fri, 2 Aug 2024 12:57:57 +0200 Subject: [PATCH] Await starting audio recorder (#21557) --- .../voice-command-dialog/ha-voice-command-dialog.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/dialogs/voice-command-dialog/ha-voice-command-dialog.ts b/src/dialogs/voice-command-dialog/ha-voice-command-dialog.ts index 169a7c1194..7df82bdc0f 100644 --- a/src/dialogs/voice-command-dialog/ha-voice-command-dialog.ts +++ b/src/dialogs/voice-command-dialog/ha-voice-command-dialog.ts @@ -486,10 +486,11 @@ export class HaVoiceCommandDialog extends LitElement { who: "user", text: "…", }; - this._audioRecorder.start().then(() => { - this._addMessage(userMessage); - this.requestUpdate("_audioRecorder"); - }); + await this._audioRecorder.start(); + + this._addMessage(userMessage); + this.requestUpdate("_audioRecorder"); + const hassMessage: Message = { who: "hass", text: "…",