fix(app): guard against undefined engine in FloatingGenerateBox preset check

form.getValues('engine') returns string | undefined; Set<string>.has()
rejects undefined under strict mode. Added a truthy guard before the
preset lookup.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
This commit is contained in:
James Pine
2026-04-18 21:04:48 -07:00
co-authored by Claude Opus 4.7
parent b91d5d74cb
commit 8fcc9b6695
@@ -146,7 +146,7 @@ export function FloatingGenerateBox({
// Cloned/designed profile with no default — ensure a compatible (non-preset) engine
const currentEngine = form.getValues('engine');
const presetEngines = new Set(['kokoro', 'qwen_custom_voice']);
if (presetEngines.has(currentEngine)) {
if (currentEngine && presetEngines.has(currentEngine)) {
form.setValue('engine', 'qwen');
}
}