diff --git a/src/Add-on/BoardCutting/AutoCuttingReactor.ts b/src/Add-on/BoardCutting/AutoCuttingReactor.ts index 7c0a8c72e..c799f79ec 100644 --- a/src/Add-on/BoardCutting/AutoCuttingReactor.ts +++ b/src/Add-on/BoardCutting/AutoCuttingReactor.ts @@ -9,17 +9,17 @@ export class AutoCuttingReactor { this.Enable = userConfig.openAutoCuttingReactor; - const cuttingCommands = ["draw", "DD", "左右侧板", "立板", "层板", "背板", "DOOR", "购买模块并插入", "插入模块", "DRAWER"]; + const cuttingCommands = new Set(["draw", "DD", "左右侧板", "立板", "层板", "背板", "DOOR", "购买模块并插入", "插入模块", "DRAWER"]); app.CommandReactor.OnCommandEnd((cmdName, changeObjects, createObjects) => { if (!this.Enable) return; - if (!cuttingCommands.includes(cmdName)) return; + if (!cuttingCommands.has(cmdName)) return; let brs = createObjects.filter(o => !o.IsErase && o instanceof Board) as Board[]; - if (cmdName !== "插入模块" && cmdName !== "购买模块并插入") + if (cmdName !== "插入模块" && cmdName !== "购买模块并插入" && cmdName !== "DRAWER") if (brs.length > 10) { app.Editor.Prompt("复制的板件超过10个,取消触发切割反应器!");