修正音效提交守卫的注释
改正 soundEffectDialog 的描述:它只是类型收窄,不做 canonical 化。 说明 canGenerate 守卫与 disabled 同源,是防止未来移除 disabled 后漏发付费请求的冗余防线。
This commit is contained in:
@@ -1407,8 +1407,10 @@ function ImageCanvasAudioGenerationComposerView({
|
||||
disabled={!canGenerate}
|
||||
aria-label={dialogLabel}
|
||||
onClick={() => {
|
||||
// SFX 提交的是 canonical 化后的 soundEffectDialog,且守卫沿用 canGenerate
|
||||
// (含空提示词与 2048 上限),不能退回通用 composer 的 dialog / !isGenerating。
|
||||
// 与 disabled 用同一个 canGenerate 做冗余守卫:原生 disabled 已经挡住点击,
|
||||
// 但若将来去掉 disabled 或换成非原生按钮,空提示词、超限和优化中仍不能把
|
||||
// 付费请求发出去。soundEffectDialog 与 dialog 值相同,这里取前者只为与
|
||||
// 本分支其余 SFX 代码保持一致。
|
||||
if (canGenerate) {
|
||||
onSubmit(soundEffectDialog);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user