We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1bb841d commit e9070faCopy full SHA for e9070fa
browser/main/Detail/SnippetNoteDetail.js
@@ -98,9 +98,10 @@ class SnippetNoteDetail extends React.Component {
98
}
99
100
handleGenerateToc () {
101
- const currentMode = this.state.note.snippets[this.state.snippetIndex].mode
+ const { note, snippetIndex } = this.state
102
+ const currentMode = note.snippets[snippetIndex].mode
103
if (currentMode.includes('Markdown')) {
- const currentEditor = this.refs['code-' + this.state.snippetIndex].refs.code.editor
104
+ const currentEditor = this.refs[`code-${snippetIndex}`].refs.code.editor
105
markdownToc.generateInEditor(currentEditor)
106
107
0 commit comments