From cdda3b5c57073ea460bf372030c91cdbf3e1c512 Mon Sep 17 00:00:00 2001 From: Brandon Thomas Date: Fri, 20 Jan 2023 04:31:06 -0500 Subject: [PATCH] fix category/voice selection bug --- .../tts_model_list/explore/ScopedVoiceModelOptions.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/fakeyou.com/src/v2/view/tts/tts_model_list/explore/ScopedVoiceModelOptions.tsx b/packages/fakeyou.com/src/v2/view/tts/tts_model_list/explore/ScopedVoiceModelOptions.tsx index c562796b07..7fb174a1ea 100644 --- a/packages/fakeyou.com/src/v2/view/tts/tts_model_list/explore/ScopedVoiceModelOptions.tsx +++ b/packages/fakeyou.com/src/v2/view/tts/tts_model_list/explore/ScopedVoiceModelOptions.tsx @@ -78,7 +78,14 @@ export function ScopedVoiceModelOptions(props: Props) { let selectedOption = options.find((option) => option.value === maybeSelectedTtsModel?.model_token); if (selectedOption === undefined && options.length > 0) { - selectedOption = options[0]; + // NB: We shouldn't select the first item in the list since that won't update the currently + // selected model. If the user were to close the dialogue, they'd think they had picked a voice, + // when in reality no state would have changed. By forcing the user to choose, the user will set + // the state appropriately. + selectedOption = { + label: "Select voice...", + value: "*", + } } const voiceCount = options.length;