mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 17:56:25 +00:00
remove console.logs & improve error handling
This commit is contained in:
@@ -642,8 +642,10 @@ export default class CodeEditor extends React.Component {
|
|||||||
try {
|
try {
|
||||||
Jsonlint.parse(customMarkdownLintConfig)
|
Jsonlint.parse(customMarkdownLintConfig)
|
||||||
lintConfigJson = JSON.parse(customMarkdownLintConfig)
|
lintConfigJson = JSON.parse(customMarkdownLintConfig)
|
||||||
|
console.log(customMarkdownLintConfig, lintConfigJson)
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
throw err
|
eventEmitter.emit('APP_SETTING_ERROR')
|
||||||
|
return
|
||||||
}
|
}
|
||||||
const lintOptions = {
|
const lintOptions = {
|
||||||
'strings': {
|
'strings': {
|
||||||
|
|||||||
@@ -194,7 +194,6 @@ class MarkdownEditor extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
reload () {
|
reload () {
|
||||||
console.log('reloading editor...')
|
|
||||||
this.refs.code.reload()
|
this.refs.code.reload()
|
||||||
this.cancelQueue()
|
this.cancelQueue()
|
||||||
this.renderPreview(this.props.value)
|
this.renderPreview(this.props.value)
|
||||||
@@ -278,7 +277,7 @@ class MarkdownEditor extends React.Component {
|
|||||||
if (this.props.ignorePreviewPointerEvents) previewStyle.pointerEvents = 'none'
|
if (this.props.ignorePreviewPointerEvents) previewStyle.pointerEvents = 'none'
|
||||||
|
|
||||||
const storage = findStorage(storageKey)
|
const storage = findStorage(storageKey)
|
||||||
console.log('render editor', config)
|
|
||||||
return (
|
return (
|
||||||
<div className={className == null
|
<div className={className == null
|
||||||
? 'MarkdownEditor'
|
? 'MarkdownEditor'
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ class UiTab extends React.Component {
|
|||||||
}})
|
}})
|
||||||
}
|
}
|
||||||
this.handleSettingError = (err) => {
|
this.handleSettingError = (err) => {
|
||||||
|
console.log('handle err', err)
|
||||||
this.setState({UiAlert: {
|
this.setState({UiAlert: {
|
||||||
type: 'error',
|
type: 'error',
|
||||||
message: err.message != null ? err.message : i18n.__('An error occurred!')
|
message: err.message != null ? err.message : i18n.__('An error occurred!')
|
||||||
|
|||||||
Reference in New Issue
Block a user