From 0a6efe933fab8a7c9fe5a0e0c39cbb877af97148 Mon Sep 17 00:00:00 2001 From: nick-delirium Date: Fri, 26 Jan 2024 11:30:07 +0100 Subject: [PATCH] fix(ui): fix updated state for condition sets delete --- .../components/ConditionalRecordingSettings.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/frontend/app/components/shared/SessionSettings/components/ConditionalRecordingSettings.tsx b/frontend/app/components/shared/SessionSettings/components/ConditionalRecordingSettings.tsx index e3f391fcb..6d713ed4a 100644 --- a/frontend/app/components/shared/SessionSettings/components/ConditionalRecordingSettings.tsx +++ b/frontend/app/components/shared/SessionSettings/components/ConditionalRecordingSettings.tsx @@ -20,6 +20,10 @@ function ConditionalRecordingSettings({ new Conditions({ name: `Condition Set ${conditions.length + 1}` }, false), ]); }; + const removeCondition = (index: number) => { + setChanged(true); + setConditions(conditions.filter((_, i) => i !== index)) + } return (
@@ -49,7 +53,7 @@ function ConditionalRecordingSettings({ set={index + 1} index={index} conditions={condition} - removeCondition={() => setConditions(conditions.filter((_, i) => i !== index))} + removeCondition={() => removeCondition(index)} readonly={false} bottomLine1={'Capture'} bottomLine2={'of total session rate matching this condition.'}