diff --git a/frontend/src/components/ChatInputBar.vue b/frontend/src/components/ChatInputBar.vue index 35862ad..da56ec4 100644 --- a/frontend/src/components/ChatInputBar.vue +++ b/frontend/src/components/ChatInputBar.vue @@ -5,6 +5,7 @@ import { useVoiceRecorder } from '@/composables/useVoiceRecorder' import { useSilenceDetector } from '@/composables/useSilenceDetector' import { useChatStore } from '@/stores/chat' import { useSettingsStore } from '@/stores/settings' +import { useToastStore } from '@/stores/toast' import type { Note } from '@/types/note' const props = withDefaults(defineProps<{ @@ -124,8 +125,15 @@ async function toggleVoice() { async function startRecording() { if (!voiceEnabled.value || recorder.recording.value) return + if (!recorder.isSupported) { + useToastStore().show('Microphone requires HTTPS or localhost', 'error') + return + } await recorder.startRecording() - if (recorder.error.value) return + if (recorder.error.value) { + useToastStore().show(recorder.error.value, 'error') + return + } if (recorder.stream.value) { silenceDetector.start(recorder.stream.value, () => stopRecording()) } @@ -224,7 +232,7 @@ defineExpose({ focus, prefill })