From 6287d7b5c2fd5dfd5c705e90735f3cac9c1cab9a Mon Sep 17 00:00:00 2001 From: chris <kokosias@yahoo.gr> Date: Wed, 19 Apr 2017 23:09:45 +0300 Subject: [PATCH] cleanup --- app/components/SimpleEditor/panes/Notes/Notes.js | 7 ++++--- app/components/SimpleEditor/panes/Notes/NotesProvider.js | 5 ++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/components/SimpleEditor/panes/Notes/Notes.js b/app/components/SimpleEditor/panes/Notes/Notes.js index 927d81f..f254738 100644 --- a/app/components/SimpleEditor/panes/Notes/Notes.js +++ b/app/components/SimpleEditor/panes/Notes/Notes.js @@ -14,7 +14,7 @@ class Notes extends Component { this.stopResize = this.stopResize.bind(this) this.saveNotes = this.saveNotes.bind(this) } - // use toc:updated to avoid rewriting TOCProvider's this.handleDocumentChange + didMount () { const provider = this.getProvider() this.context.editorSession.onUpdate('document', this.onNotesUpdated, this) @@ -100,8 +100,8 @@ class Notes extends Component { const configurator = new Configurator().import(config) const exporter = new SimpleExporter(configurator.config) - forEach(notes.main, function (mainNote, indexmain) { - forEach(notes.mini, function (miniNote, indexmini) { + forEach(notes.main, function (mainNote) { + forEach(notes.mini, function (miniNote) { if (miniNote.parentNoteId === mainNote.id) { const exportedNode = exporter.convertNode(miniNote) this.context.editorSession.transaction(function (tx, args) { @@ -111,6 +111,7 @@ class Notes extends Component { } }.bind(this)) }.bind(this)) + return new Promise(function (resolve, reject) { resolve() }) diff --git a/app/components/SimpleEditor/panes/Notes/NotesProvider.js b/app/components/SimpleEditor/panes/Notes/NotesProvider.js index def88b9..1697133 100644 --- a/app/components/SimpleEditor/panes/Notes/NotesProvider.js +++ b/app/components/SimpleEditor/panes/Notes/NotesProvider.js @@ -1,6 +1,6 @@ import _ from 'lodash' -import { TOCProvider, Component } from 'substance' +import { TOCProvider } from 'substance' class NotesProvider extends TOCProvider { computeEntries () { @@ -24,10 +24,9 @@ class NotesProvider extends TOCProvider { const entriesMain = this.sortNodes(notesMain) const entriesMini = _.values(notesMini) - // console.log(entriesMain, entriesMini) const entries = { main: entriesMain, - mini: notesMini + mini: entriesMini } if (entriesMini && entriesMain.length < entriesMini.length) { -- GitLab