diff --git a/app/components/pages/utilities/text-to-speech.tsx b/app/components/pages/utilities/text-to-speech.tsx index 6e13814..bf77ea8 100644 --- a/app/components/pages/utilities/text-to-speech.tsx +++ b/app/components/pages/utilities/text-to-speech.tsx @@ -46,8 +46,10 @@ export default function TextToSpeech() { const form = useForm({ resolver: zodResolver(TextToSpeechSchema), + mode: 'onChange', defaultValues: { text: '', rate: 1, pitch: 1, voice: '' }, }); + const canPlay = TextToSpeechSchema.shape.text.safeParse(form.watch('text')).success; function onsubmit(data: TextToSpeechType) { const s = globalThis.speechSynthesis; @@ -175,11 +177,7 @@ export default function TextToSpeech() { />
-