From da9ab4a64f336a65a62b34bc48cfe68e7c2a7982 Mon Sep 17 00:00:00 2001 From: Lavissa Date: Tue, 2 Jul 2024 02:25:22 +0200 Subject: [PATCH] [PUI] Fix choice-based settings showing as string fields (#7543) --- src/frontend/src/components/settings/SettingList.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/frontend/src/components/settings/SettingList.tsx b/src/frontend/src/components/settings/SettingList.tsx index c94fcae01d..e531fbf4f7 100644 --- a/src/frontend/src/components/settings/SettingList.tsx +++ b/src/frontend/src/components/settings/SettingList.tsx @@ -49,12 +49,12 @@ export function SettingList({ // Determine the field type of the setting const fieldType = useMemo(() => { - if (setting?.type != undefined) { - return setting.type; + if (setting?.choices?.length) { + return 'choice'; } - if (setting?.choices != undefined && setting.choices.length > 0) { - return 'choice'; + if (setting?.type != undefined) { + return setting.type; } return 'string';