fix(ui): fix updated state for condition sets delete

This commit is contained in:
nick-delirium 2024-01-26 11:30:07 +01:00
parent bb1b8e9a26
commit 0a6efe933f

View file

@ -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 (
<div className={'relative py-1 px-5'}>
@ -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.'}