Skip to content

Commit

Permalink
this works?
Browse files Browse the repository at this point in the history
  • Loading branch information
futurepaul committed Feb 10, 2024
1 parent 1048318 commit 74c1156
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/components/ChooseLanguage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export function ChooseLanguage() {
const [_chooseLanguageForm, { Form, Field }] =
createForm<ChooseLanguageForm>({
initialValues: {
selectedLanguage: findLanguageByValue(state.lang ?? "").value,
selectedLanguage: findLanguageByValue(state.lang ?? "").value
},
validate: (values) => {
const errors: Record<string, string> = {};
Expand All @@ -46,7 +46,7 @@ export function ChooseLanguage() {
const handleFormSubmit = async (f: ChooseLanguageForm) => {
setLoading(true);
try {
actions.saveLanguage(findLanguageByValue(f.selectedLanguage).label);
actions.saveLanguage(findLanguageByValue(f.selectedLanguage).value);

await i18n.changeLanguage(
findLanguageByValue(f.selectedLanguage).label
Expand Down Expand Up @@ -79,7 +79,12 @@ export function ChooseLanguage() {
>
<For each={COMBINED_OPTIONS}>
{({ value }) => (
<option value={value}>{value}</option>
<option
selected={field.value === value}
value={value}
>
{value}
</option>
)}
</For>
</select>
Expand Down

0 comments on commit 74c1156

Please sign in to comment.