fix(frontend): bedrock_cc_compat toggle not persisting on reload

apiToForm read bedrock_cc_compat as Record<string, boolean> (nested map)
but formToAPI saves it as a plain bool. Reading true["anthropic"] returns
undefined, so the toggle always appeared off after save.

Align the read path with the write path: fc?.bedrock_cc_compat === true.
This commit is contained in:
erio
2026-06-10 00:18:28 +08:00
parent 12962bab24
commit 72c112164e
+1 -2
View File
@@ -1205,8 +1205,7 @@ function apiToForm(channel: Channel): PlatformSection[] {
const webSearchEnabled = wsEmulation?.[platform] === true
const codexImageGenerationBridge = fc?.codex_image_generation_bridge as Record<string, boolean> | undefined
const codexImageGenerationBridgeEnabled = codexImageGenerationBridge?.[platform] === true
const bedrockCCCompat = fc?.bedrock_cc_compat as Record<string, boolean> | undefined
const bedrockCCCompatEnabled = bedrockCCCompat?.[platform] === true
const bedrockCCCompatEnabled = fc?.bedrock_cc_compat === true
sections.push({
platform,