Skip to content

Commit

Permalink
Merge pull request #266 from mjmlio/fix-detectOldSyntax
Browse files Browse the repository at this point in the history
fix detectOldSyntax button appearance
  • Loading branch information
kmcb777 authored Mar 8, 2019
2 parents f83cb7a + 1a2e3a1 commit 0bf6f8e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/components/FileEditor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,7 @@ class FileEditor extends Component {

detecteOldSyntax = () => {
const content = this.getContent()
if (isOldSyntax(content)) {
this.props.onDetectOldSyntax()
}
this.props.onDetectOldSyntax(isOldSyntax(content))
}

async loadContent() {
Expand Down Expand Up @@ -255,6 +253,8 @@ class FileEditor extends Component {
await fsWriteFile(fileName, mjml)
setPreview(fileName, mjml)
}

window.requestIdleCallback(this.detecteOldSyntax)
}, 200)

getContent = () => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/FilesList/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class FilesList extends Component {
ipcRenderer.removeListener('browser-window-focus', this.refresh)
}

handleDetectOldSyntax = () => this.setState({ isOldSyntaxDetected: true })
handleDetectOldSyntax = val => this.setState({ isOldSyntaxDetected: val })

handleSubmit = e => {
e.preventDefault()
Expand Down

0 comments on commit 0bf6f8e

Please sign in to comment.