Skip to content

Commit

Permalink
ui fix: Changing voice fields should retrigger audio
Browse files Browse the repository at this point in the history
  • Loading branch information
mrdjohnson committed Jul 25, 2024
1 parent c406465 commit ca546f0
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/features/settings/panels/general/AppGeneralPanel.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { observer } from 'mobx-react-lite'
import { getSnapshot } from 'mobx-state-tree'
import { useEffect, useMemo, useState } from 'react'
import { useEffect, useState } from 'react'
import { useSpeech, useVoices } from 'react-text-to-speech'

import ThemeSelector from '~/components/ThemeSelector'
Expand All @@ -18,7 +18,7 @@ import { connectionModelStore } from '~/features/connections/ConnectionModelStor

import { ChatStoreSnapshotHandler } from '~/utils/transfer/ChatStoreSnapshotHandler'
import { Select, SelectItem, Switch } from '@nextui-org/react'
import { Controller, useForm } from 'react-hook-form'
import { useForm } from 'react-hook-form'

const DownlodSelector = () => {
const [includeImages, setIncludeImages] = useState(true)
Expand Down Expand Up @@ -88,7 +88,7 @@ const SpeechSelector = observer(() => {
const {
handleSubmit,
reset,
getValues,
watch,
register,
formState: { isDirty },
} = useForm<VoiceFormDataType>()
Expand All @@ -106,8 +106,8 @@ const SpeechSelector = observer(() => {
reset(voice)
})

const selectedLanguage = getValues('language')
const selectedVoiceUri = getValues('voiceUri')
const selectedLanguage = watch('language')
const selectedVoiceUri = watch('voiceUri')

useEffect(() => {
reset({
Expand Down

0 comments on commit ca546f0

Please sign in to comment.