diff --git a/packages/fakeyou.com/src/v2/view/tts/tts_model_list/explore/CategoryOptions.tsx b/packages/fakeyou.com/src/v2/view/tts/tts_model_list/explore/CategoryOptions.tsx index e4c2422941..3ac233993e 100644 --- a/packages/fakeyou.com/src/v2/view/tts/tts_model_list/explore/CategoryOptions.tsx +++ b/packages/fakeyou.com/src/v2/view/tts/tts_model_list/explore/CategoryOptions.tsx @@ -166,18 +166,10 @@ export function CategoryOptions(props: Props) { let categoryDropdowns = buildDropdowns( dropdownCategories, + selectedCategories, ttsModelsByCategoryToken, handleChangeCategory); - const options = [ - { value: "chocolate", label: "Chocolate" }, - { value: "strawberry", label: "Strawberry" }, - { value: "vanilla", label: "Vanilla" }, - { value: "chocolate", label: "Chocolate" }, - { value: "strawberry", label: "Strawberry" }, - { value: "vanilla", label: "Vanilla" }, - ]; - const CATEGORY_SEPARATOR = (
>, handleChangeCategory : (i: number, categoryToken?: string) => void, ) { @@ -214,6 +207,7 @@ function buildDropdowns( for (let i = 0; i < dropdownCategories.length; i++) { const currentDropdownCategories = dropdownCategories[i]; + const selectedCategory = selectedCategories[i]; let defaultName = i === 0 ? "All Voices" : "Select..."; @@ -255,6 +249,14 @@ function buildDropdowns( ); }); + let selectedCategoryOption = undefined; + if (selectedCategory !== undefined) { + selectedCategoryOption = { + value: selectedCategory.category_token, + label: selectedCategory.name_for_dropdown, + }; + } + if (dropdownOptions.length <= 1) { // We've run out of subcategories. (1 == "Select...") // No sense trying to build more. @@ -269,7 +271,7 @@ function buildDropdowns( 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 858081f280..d9a931d51b 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 @@ -98,7 +98,7 @@ export function ScopedVoiceModelOptions(props: Props) {