Skip to content

Commit

Permalink
fix: delete last condition
Browse files Browse the repository at this point in the history
  • Loading branch information
hyoban committed Nov 18, 2024
1 parent 0eef76b commit 72d894a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion apps/renderer/src/modules/settings/action-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,11 @@ export function ActionCard({
<DeleteTableCell
disabled={disabled}
onClick={() => {
data.condition[orConditionIdx].splice(conditionIdx, 1)
if (data.condition[orConditionIdx].length === 1) {
data.condition.splice(orConditionIdx, 1)
} else {
data.condition[orConditionIdx].splice(conditionIdx, 1)
}
onChange(data)
}}
/>
Expand Down

0 comments on commit 72d894a

Please sign in to comment.