🐛 Avoid error when we delete a date
parent
1b29cd76b7
commit
569eca1174
|
@ -1,4 +1,9 @@
|
|||
import { goToQuestion, stepAction, updateSituation } from '@/actions/actions'
|
||||
import {
|
||||
deleteFromSituation,
|
||||
goToQuestion,
|
||||
stepAction,
|
||||
updateSituation,
|
||||
} from '@/actions/actions'
|
||||
import RuleInput from '@/components/conversation/RuleInput'
|
||||
import Notifications from '@/components/Notifications'
|
||||
import QuickLinks from '@/components/QuickLinks'
|
||||
|
@ -51,7 +56,12 @@ export default function Conversation({
|
|||
dispatch(goToQuestion(previousAnswers.slice(-1)[0]))
|
||||
|
||||
const onChange = (value: PublicodesExpression | undefined) => {
|
||||
dispatch(updateSituation(currentQuestion, value))
|
||||
dispatch(
|
||||
(value == null ? deleteFromSituation : updateSituation)(
|
||||
currentQuestion,
|
||||
value
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
return (
|
||||
|
|
Loading…
Reference in New Issue