mirror of
https://github.com/formbricks/formbricks.git
synced 2025-12-30 02:10:12 -06:00
fix: undefined conditions or actions
This commit is contained in:
@@ -86,7 +86,7 @@ export function AdvancedLogicEditorActions({
|
||||
<div className="flex grow gap-2">
|
||||
<CornerDownRightIcon className="mt-3 h-4 w-4 shrink-0" />
|
||||
<div className="flex grow flex-col gap-y-2">
|
||||
{actions.map((action, idx) => (
|
||||
{actions?.map((action, idx) => (
|
||||
<div className="flex grow items-center justify-between gap-x-2">
|
||||
<div className="block w-9 shrink-0">{idx === 0 ? "Then" : "and"}</div>
|
||||
<div className="flex grow items-center gap-x-2">
|
||||
|
||||
@@ -335,7 +335,7 @@ export function AdvancedLogicEditorConditions({
|
||||
|
||||
return (
|
||||
<div className="flex flex-col gap-y-2">
|
||||
{conditions.conditions.map((condition, index) => renderCondition(condition, index, conditions))}
|
||||
{conditions?.conditions.map((condition, index) => renderCondition(condition, index, conditions))}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@ export const QuestionsView = ({
|
||||
const updateConditions = (conditions: TConditionGroup): TConditionGroup => {
|
||||
return {
|
||||
...conditions,
|
||||
conditions: conditions.conditions.map((condition) => {
|
||||
conditions: conditions?.conditions.map((condition) => {
|
||||
if (isConditionsGroup(condition)) {
|
||||
return updateConditions(condition);
|
||||
} else {
|
||||
|
||||
@@ -1278,7 +1278,6 @@ const validateLogic = (
|
||||
...validateActions(survey, questionIndex, logicIndex, logicItem.actions),
|
||||
];
|
||||
});
|
||||
|
||||
return logicIssues.flat();
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user