Skip to content

Commit cc4d7a5

Browse files
committed
fix : 选择进入子弹时间时 name 和 location 必填一项校验不生效的问题
1 parent 087dc7c commit cc4d7a5

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/components/editor/action/validation.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,15 @@ export function validateAction(
66
action: CopilotDocV1.Action,
77
setError: UseFormSetError<CopilotDocV1.Action>,
88
) {
9-
if (action.type === 'Skill' || action.type === 'Retreat') {
9+
if (
10+
action.type === 'Skill' ||
11+
action.type === 'Retreat' ||
12+
action.type === 'BulletTime'
13+
) {
1014
if (!action.name && !action.location) {
1115
const error = {
1216
type: 'required',
13-
message: '类型为技能或撤退时,必须填写名称或位置其中一个',
17+
message: '类型为技能、撤退或子弹时间时,必须填写名称或位置其中一个',
1418
}
1519
setError('name', error)
1620
setError('location', error)

src/models/copilot.schema.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export namespace CopilotDocV1 {
6767
}
6868

6969
export interface ActionUtil extends ActionBase {
70-
type: Type.SpeedUp | Type.BulletTime | Type.Output | Type.SkillDaemon
70+
type: Type.SpeedUp | Type.Output | Type.SkillDaemon
7171
}
7272

7373
export interface ActionMoveCamera extends ActionBase {

0 commit comments

Comments
 (0)