Skip to content

Commit

Permalink
Fix loading new column block
Browse files Browse the repository at this point in the history
  • Loading branch information
tiberiuichim committed Sep 28, 2020
1 parent c5c1b96 commit 0439073
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/ColumnsBlock/ColumnsBlockEdit.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,13 @@ class ColumnsBlockEdit extends React.Component {
getColumnsBlockSchema = () => {
const schema = ColumnsBlockSchema();
const { data } = this.props;
const { gridCols } = data;
const { gridCols = [] } = data;
console.log('gridcols', gridCols);
const available_variants = variants.filter(
({ defaultData }) => defaultData.gridCols.length === gridCols.length,
({ defaultData }) => defaultData?.gridCols?.length === gridCols.length,
);
schema.properties.gridCols.choices = available_variants.map(
({ defaultData, title }) => [defaultData.gridCols, title],
({ defaultData, title }) => [defaultData?.gridCols, title],
);
return schema;
};
Expand Down

0 comments on commit 0439073

Please sign in to comment.