Skip to content

Commit

Permalink
fix: crash on undefined list when changing TTS engines
Browse files Browse the repository at this point in the history
  • Loading branch information
Vali-98 committed Aug 16, 2024
1 parent 4a685b0 commit 4c8dd5e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions app/TTSMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ const TTSMenu = () => {
}, [])

const getVoices = (value = false) => {
if (enableTTS ?? value)
Speech.getAvailableVoicesAsync().then((list) => setModelList((current) => list))
if (enableTTS ?? value) Speech.getAvailableVoicesAsync().then((list) => setModelList(list))
}

return (
Expand Down Expand Up @@ -130,7 +129,7 @@ const TTSMenu = () => {
{modelList.length !== 0 && (
<Dropdown
value={currentSpeaker?.identifier ?? ''}
data={languageList[lang]}
data={languageList?.[lang] ?? []}
labelField="identifier"
valueField="name"
placeholder="Select Speaker"
Expand Down

0 comments on commit 4c8dd5e

Please sign in to comment.