mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-09-24 16:05:44 +08:00
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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user