mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-15 10:46:32 +00:00
Merge pull request #2438 from jacobherrington/fix-type-error-on-snippets
Fix TypeError thrown on the Snippets page
This commit is contained in:
@@ -41,6 +41,7 @@ class SnippetTab extends React.Component {
|
|||||||
|
|
||||||
handleSnippetSelect (snippet) {
|
handleSnippetSelect (snippet) {
|
||||||
const { currentSnippet } = this.state
|
const { currentSnippet } = this.state
|
||||||
|
if (snippet !== null) {
|
||||||
if (currentSnippet === null || currentSnippet.id !== snippet.id) {
|
if (currentSnippet === null || currentSnippet.id !== snippet.id) {
|
||||||
dataApi.fetchSnippet(snippet.id).then(changedSnippet => {
|
dataApi.fetchSnippet(snippet.id).then(changedSnippet => {
|
||||||
// notify the snippet editor to load the content of the new snippet
|
// notify the snippet editor to load the content of the new snippet
|
||||||
@@ -49,6 +50,7 @@ class SnippetTab extends React.Component {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
onSnippetNameOrPrefixChanged (e, type) {
|
onSnippetNameOrPrefixChanged (e, type) {
|
||||||
const newSnippet = Object.assign({}, this.state.currentSnippet)
|
const newSnippet = Object.assign({}, this.state.currentSnippet)
|
||||||
|
|||||||
Reference in New Issue
Block a user