mirror of
https://github.com/BoostIo/Boostnote
synced 2026-01-10 07:29:23 +00:00
Changes to pass tests and lint code
This commit is contained in:
@@ -410,7 +410,7 @@ class SnippetNoteDetail extends React.Component {
|
||||
return (e) => {
|
||||
const snippets = this.state.note.snippets.slice()
|
||||
snippets[index].content = this.refs['code-' + index].value
|
||||
snippets[index].linesHighlighted=e.options.linesHighlighted
|
||||
snippets[index].linesHighlighted = e.options.linesHighlighted
|
||||
|
||||
this.setState(state => ({note: Object.assign(state.note, {snippets: snippets})}))
|
||||
this.setState(state => ({
|
||||
@@ -605,7 +605,7 @@ class SnippetNoteDetail extends React.Component {
|
||||
name: '',
|
||||
mode: config.editor.snippetDefaultLanguage || 'text',
|
||||
content: '',
|
||||
linesHighlighted:[]
|
||||
linesHighlighted: []
|
||||
}])
|
||||
const snippetIndex = note.snippets.length - 1
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ function validateInput (input) {
|
||||
name: '',
|
||||
mode: 'text',
|
||||
content: '',
|
||||
linesHighlighted:[],
|
||||
linesHighlighted: []
|
||||
}]
|
||||
}
|
||||
break
|
||||
|
||||
@@ -52,7 +52,7 @@ function validateInput (input) {
|
||||
name: '',
|
||||
mode: 'text',
|
||||
content: '',
|
||||
linesHighlighted:[],
|
||||
linesHighlighted: []
|
||||
}]
|
||||
} else {
|
||||
validatedInput.snippets = input.snippets
|
||||
@@ -98,7 +98,7 @@ function updateNote (storageKey, noteKey, input) {
|
||||
name: '',
|
||||
mode: 'text',
|
||||
content: '',
|
||||
linesHighlighted:[],
|
||||
linesHighlighted: []
|
||||
}]
|
||||
}
|
||||
: {
|
||||
|
||||
@@ -12,8 +12,8 @@ function updateSnippet (snippet, snippetFile) {
|
||||
if (
|
||||
currentSnippet.name === snippet.name &&
|
||||
currentSnippet.prefix === snippet.prefix &&
|
||||
currentSnippet.content === snippet.content &&
|
||||
currentSnippet.linesHighlighted===snippet.linesHighlighted
|
||||
currentSnippet.content === snippet.content &&
|
||||
currentSnippet.linesHighlighted === snippet.linesHighlighted
|
||||
) {
|
||||
// if everything is the same then don't write to disk
|
||||
resolve(snippets)
|
||||
|
||||
Reference in New Issue
Block a user