mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 17:56:25 +00:00
Fixed last nonfunctional changes made earlier
Now iterates in the SnippetNoteDetail constructor the snippets and if linesHighlighted is not defined assigns an empty array
This commit is contained in:
@@ -52,6 +52,12 @@ class SnippetNoteDetail extends React.Component {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.state.note.snippets.forEach(function (s) {
|
||||||
|
if (s.linesHighlighted === undefined) {
|
||||||
|
s.linesHighlighted = []
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
this.scrollToNextTabThreshold = 0.7
|
this.scrollToNextTabThreshold = 0.7
|
||||||
this.generateToc = () => this.handleGenerateToc()
|
this.generateToc = () => this.handleGenerateToc()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -97,13 +97,13 @@ class Main extends React.Component {
|
|||||||
name: 'example.html',
|
name: 'example.html',
|
||||||
mode: 'html',
|
mode: 'html',
|
||||||
content: "<html>\n<body>\n<h1 id='hello'>Enjoy Boostnote!</h1>\n</body>\n</html>",
|
content: "<html>\n<body>\n<h1 id='hello'>Enjoy Boostnote!</h1>\n</body>\n</html>",
|
||||||
linesHighlighted:[]
|
linesHighlighted: []
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'example.js',
|
name: 'example.js',
|
||||||
mode: 'javascript',
|
mode: 'javascript',
|
||||||
content: "var boostnote = document.getElementById('enjoy').innerHTML\n\nconsole.log(boostnote)",
|
content: "var boostnote = document.getElementById('enjoy').innerHTML\n\nconsole.log(boostnote)",
|
||||||
linesHighlighted:[]
|
linesHighlighted: []
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ function createSnippet (snippetFile) {
|
|||||||
name: 'Unnamed snippet',
|
name: 'Unnamed snippet',
|
||||||
prefix: [],
|
prefix: [],
|
||||||
content: '',
|
content: '',
|
||||||
linesHighlighted: [],
|
linesHighlighted: []
|
||||||
}
|
}
|
||||||
fetchSnippet(null, snippetFile).then((snippets) => {
|
fetchSnippet(null, snippetFile).then((snippets) => {
|
||||||
snippets.push(newSnippet)
|
snippets.push(newSnippet)
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ function importAll (storage, data) {
|
|||||||
name: article.mode,
|
name: article.mode,
|
||||||
mode: article.mode,
|
mode: article.mode,
|
||||||
content: article.content,
|
content: article.content,
|
||||||
linesHighlighted: article.linesHighlighted,
|
linesHighlighted: article.linesHighlighted
|
||||||
}]
|
}]
|
||||||
}
|
}
|
||||||
notes.push(newNote)
|
notes.push(newNote)
|
||||||
|
|||||||
@@ -118,8 +118,6 @@ function updateNote (storageKey, noteKey, input) {
|
|||||||
|
|
||||||
if (noteData.type === 'SNIPPET_NOTE') {
|
if (noteData.type === 'SNIPPET_NOTE') {
|
||||||
noteData.title
|
noteData.title
|
||||||
if(noteData.linesHighlighted = null)
|
|
||||||
noteData.linesHighlighted = [];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Object.assign(noteData, input, {
|
Object.assign(noteData, input, {
|
||||||
|
|||||||
Reference in New Issue
Block a user