diff --git a/src/app/components/Chat.svelte b/src/app/components/Chat.svelte index 93243347..ee8916a1 100644 --- a/src/app/components/Chat.svelte +++ b/src/app/components/Chat.svelte @@ -353,6 +353,7 @@ {onEscape} {onEditPrevious} {initialValues} + dictationKey={draftKey.key} draftKey={eventToEdit ? undefined : draftKey} disabled={Boolean(missingRelayLists.length)} /> {/key} diff --git a/src/app/components/ChatCompose.svelte b/src/app/components/ChatCompose.svelte index 3f377f9e..69d29586 100644 --- a/src/app/components/ChatCompose.svelte +++ b/src/app/components/ChatCompose.svelte @@ -13,12 +13,14 @@ import DictationButton from "@app/components/DictationButton.svelte" import EditorContent from "@app/editor/EditorContent.svelte" import {makeEditor} from "@app/editor" + import {getDictation} from "@app/dictation" import {type DraftKey, type Draft} from "@app/drafts" import {pushToast} from "@app/toast" import type {Share} from "@app/share" type Props = { disabled?: boolean + dictationKey: string draftKey?: DraftKey onEscape?: () => void onEditPrevious?: () => void @@ -29,6 +31,7 @@ const { initialValues, disabled = false, + dictationKey, draftKey, onEscape, onEditPrevious, @@ -94,7 +97,7 @@ let content = $state( initialValues?.type === "text" ? initialValues.value : (draftKey?.get()?.content ?? ""), ) - let recording = $state(false) + let dictating = $state(Boolean(getDictation(dictationKey))) const onChange = (json: object) => { content = json @@ -152,8 +155,8 @@
- {#if recording || ($empty && !disabled)} - + {#if dictating || ($empty && !disabled)} + {:else}