mirror of
https://github.com/lordmathis/llamactl.git
synced 2025-11-06 00:54:23 +00:00
Improve cleanup of options in InstanceDialog to skip empty strings and arrays
This commit is contained in:
@@ -123,8 +123,12 @@ const InstanceDialog: React.FC<InstanceDialogProps> = ({
|
|||||||
if (Object.keys(cleanBackendOptions).length > 0) {
|
if (Object.keys(cleanBackendOptions).length > 0) {
|
||||||
(cleanOptions as any)[key] = cleanBackendOptions;
|
(cleanOptions as any)[key] = cleanBackendOptions;
|
||||||
}
|
}
|
||||||
} else if (value !== undefined && value !== null && (typeof value !== 'string' || value.trim() !== "")) {
|
} else if (value !== undefined && value !== null) {
|
||||||
// Handle arrays - don't include empty arrays
|
// Skip empty strings
|
||||||
|
if (typeof value === 'string' && value.trim() === "") {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// Skip empty arrays
|
||||||
if (Array.isArray(value) && value.length === 0) {
|
if (Array.isArray(value) && value.length === 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user