Skip to content

Commit

Permalink
🔨 Leave chart props the same when switching between
Browse files Browse the repository at this point in the history
  • Loading branch information
timmo001 committed Sep 22, 2019
1 parent edaa242 commit a415cd3
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/Components/Configuration/EditCard/EditCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,18 @@ function EditCard(props: EditCardProps) {
group: card.group
});
case 'chart':
return setCard({
...card,
[event.target.name as string]: event.target.value,
chart_detail: 4,
chart_from: 3
});
if (!card.chart)
return setCard({
...card,
[event.target.name as string]: event.target.value,
chart_detail: 4,
chart_from: 3
});
else
return setCard({
...card,
[event.target.name as string]: event.target.value
});
}
}

Expand Down

0 comments on commit a415cd3

Please sign in to comment.