mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 09:46:22 +00:00
Refactoring : use object destructuring to retain file code style
This commit is contained in:
@@ -98,9 +98,10 @@ class SnippetNoteDetail extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
handleGenerateToc () {
|
handleGenerateToc () {
|
||||||
const currentMode = this.state.note.snippets[this.state.snippetIndex].mode
|
const { note, snippetIndex } = this.state
|
||||||
|
const currentMode = note.snippets[snippetIndex].mode
|
||||||
if (currentMode.includes('Markdown')) {
|
if (currentMode.includes('Markdown')) {
|
||||||
const currentEditor = this.refs['code-' + this.state.snippetIndex].refs.code.editor
|
const currentEditor = this.refs[`code-${snippetIndex}`].refs.code.editor
|
||||||
markdownToc.generateInEditor(currentEditor)
|
markdownToc.generateInEditor(currentEditor)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user