Skip to content

Commit 93bfb1a

Browse files
authored
Merge pull request #216 from MaaAssistantArknights/dev
Release
2 parents 17f70d2 + 3655ebf commit 93bfb1a

File tree

13 files changed

+105
-21
lines changed

13 files changed

+105
-21
lines changed
62.6 KB
Loading
53.6 KB
Loading
65.8 KB
Loading
51.5 KB
Loading
45.1 KB
Loading
54 KB
Loading
56.5 KB
Loading
17.2 KB
Loading

src/components/OperatorSelect.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,11 @@ export const OperatorSelect: FC<OperatorSelectProps> = ({
7878
}
7979

8080
const add = (operation: OperatorInfo) => {
81-
change([...new Set([...operators, { name: operation.name }])])
81+
if (!operators.some((op) => op.name === operation.name)) {
82+
change([...operators, { name: operation.name }])
83+
} else {
84+
remove(operation)
85+
}
8286
}
8387

8488
const remove = (operation: OperatorInfo) => {

src/components/editor/action/EditorActionAdd.tsx

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -259,20 +259,22 @@ export const EditorActionAdd = ({
259259
<div className="h-px w-full bg-gray-200 mt-4 mb-6" />
260260

261261
<EditorActionModule
262-
title="执行条件" icon="stopwatch" className="font-bold"
262+
title="执行条件"
263+
icon="stopwatch"
264+
className="font-bold"
263265
>
264-
<div className="flex flex-wrap">
265-
<EditorActionExecPredicateKills control={control} />
266-
<EditorActionExecPredicateCooling control={control} />
267-
</div>
268-
<div className="flex flex-wrap">
269-
<EditorActionExecPredicateCosts control={control} />
270-
<EditorActionExecPredicateCostChange control={control} />
271-
</div>
272-
<div className="flex flex-wrap">
273-
<EditorActionPreDelay control={control} />
274-
<EditorActionRearDelay control={control} />
275-
</div>
266+
<div className="flex flex-wrap">
267+
<EditorActionExecPredicateKills control={control} />
268+
<EditorActionExecPredicateCooling control={control} />
269+
</div>
270+
<div className="flex flex-wrap">
271+
<EditorActionExecPredicateCosts control={control} />
272+
<EditorActionExecPredicateCostChange control={control} />
273+
</div>
274+
<div className="flex flex-wrap">
275+
<EditorActionPreDelay control={control} />
276+
<EditorActionRearDelay control={control} />
277+
</div>
276278
</EditorActionModule>
277279
<div className="h-px w-full bg-gray-200 mt-4 mb-6" />
278280

@@ -309,7 +311,7 @@ export const EditorActionAdd = ({
309311
/>
310312
</div>
311313
</EditorActionModule>
312-
314+
313315
<div className="mt-4 flex">
314316
<Button intent="primary" type="submit" icon={isNew ? 'add' : 'edit'}>
315317
{isNew ? '添加' : '保存'}

0 commit comments

Comments
 (0)