Skip to content

Commit

Permalink
Fix template editor update
Browse files Browse the repository at this point in the history
  • Loading branch information
inukshuk committed Feb 12, 2019
1 parent c357a0e commit b8d1e82
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/components/template/editor.js
Expand Up @@ -21,6 +21,15 @@ const {
class TemplateEditor extends React.PureComponent {
state = newTemplate()

componentDidUpdate(props) {
if (props.templates !== this.props.templates) {
let template = this.props.templates.find(t => t.id === this.state.id)
if (template != null) {
this.handleTemplateChange(template)
}
}
}

get isPristine() {
return this.state.created == null
}
Expand Down

0 comments on commit b8d1e82

Please sign in to comment.