1
Fork 0
mirror of https://github.com/pds-nest/nest.git synced 2024-11-21 20:44:18 +00:00

🐛 Fix conditions not able to be deleted

This commit is contained in:
Steffo 2021-05-30 16:46:21 +02:00
parent ab82f66073
commit a25e3ba223
Signed by: steffo
GPG key ID: 6965406171929D01

View file

@ -32,14 +32,14 @@ export default function RepositoryEditor({
const [_name, setName] = useState(name ?? "") const [_name, setName] = useState(name ?? "")
/** The conditions of the data gathering. */ /** The conditions of the data gathering. */
const parsedConditions = conditions.map(cond => Condition.fromRaw(cond))
const { const {
value: rawConditions, value: _conditions,
setValue: setRawConditions, setValue: setRawConditions,
appendValue: appendRawCondition, appendValue: appendRawCondition,
removeValue: removeRawCondition, removeValue: removeRawCondition,
spliceValue: spliceRawCondition, spliceValue: spliceRawCondition,
} = useArrayState(conditions) } = useArrayState(parsedConditions)
const _conditions = rawConditions.map(cond => Condition.fromRaw(cond))
/** The operator the conditions should be evaluated with. */ /** The operator the conditions should be evaluated with. */
const [_evaluationMode, setEvaluationMode] = useState(evaluationMode ?? 0) const [_evaluationMode, setEvaluationMode] = useState(evaluationMode ?? 0)