Skip to content

Commit

Permalink
refactor code
Browse files Browse the repository at this point in the history
  • Loading branch information
nileshgulia1 committed Jul 25, 2021
1 parent a1da86e commit c39275f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
Binary file added .DS_Store
Binary file not shown.
8 changes: 3 additions & 5 deletions src/EmbedChartBlock/Edit.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ class EmbedChartBlockEdit extends Component {
const { block } = this.props; // , data, onChangeBlock, selected, title

const hasNewEditorData =
this.props.data && this.props.data.text && this.props.data.text.blocks
? this.props.data.text.editor && this.props.data.text.editor === 'slate'
this.props.data?.text?.blocks && this.props.data.text.editor
? this.props.data.text.editor === 'slate'
: true;

return (
Expand Down Expand Up @@ -124,9 +124,7 @@ class EmbedChartBlockEdit extends Component {
columns={1}
properties={this.props.data}
value={
this.props.data.text && this.props.data.text.blocks
? this.props.data.text.blocks
: this.getDefaultValue()
this.props.data?.text?.blocks || this.getDefaultValue()
}
placeholder="Type text..."
/>
Expand Down

0 comments on commit c39275f

Please sign in to comment.