1
0
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:
Maciek
2018-09-02 19:38:15 +02:00
parent 1bb841d5c5
commit e9070fadab

View File

@@ -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)
} }
} }