Skip to content
Snippets Groups Projects
Commit 949e82ed authored by Atte Keinänen's avatar Atte Keinänen
Browse files

Make the handleOnChangeCardAndRun work correctly also on QB drills

parent 16742c6e
Branches
Tags
No related merge requests found
......@@ -227,18 +227,13 @@ export default class Visualization extends Component<*, Props, State> {
// If the current card is saved, carry that information to the new card for showing lineage
const { series, clicked } = this.state;
if (clicked == null) {
console.error("The visualization wasn't clicked before calling `onChangeCardAndRun`");
return;
}
const index = clicked.seriesIndex;
const index = (clicked && clicked.seriesIndex) || 0;
// $FlowFixMe
const cardId = series[index] && series[index].card && series[index].card.id;
if (cardId) {
const savedCard: CardObject = {
...card,
// $FlowFixMe
id: cardId
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment