[PUI] Fix choice-based settings showing as string fields (#7543)

This commit is contained in:
Lavissa 2024-07-02 02:25:22 +02:00 committed by GitHub
parent ee97f0859d
commit da9ab4a64f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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';