From 72d894a754ba3a0c3b6c4e030b3b274dc98de6b6 Mon Sep 17 00:00:00 2001 From: Stephen Zhou <38493346+hyoban@users.noreply.github.com> Date: Mon, 18 Nov 2024 13:22:14 +0800 Subject: [PATCH] fix: delete last condition --- apps/renderer/src/modules/settings/action-card.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/renderer/src/modules/settings/action-card.tsx b/apps/renderer/src/modules/settings/action-card.tsx index 0d69e3c03b..5613fc16d9 100644 --- a/apps/renderer/src/modules/settings/action-card.tsx +++ b/apps/renderer/src/modules/settings/action-card.tsx @@ -431,7 +431,11 @@ export function ActionCard({ { - 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) }} />