From d5f48b71a6d5249e879334618218067f37bd724f Mon Sep 17 00:00:00 2001 From: Alexandros Georgantas <alexgeorg86@gmail.com> Date: Thu, 16 Feb 2017 16:47:32 +0200 Subject: [PATCH] Fix of save functionality --- app/components/SimpleEditor/SimpleEditor.jsx | 2 +- app/components/SimpleEditor/SimpleEditorWrapper.jsx | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/app/components/SimpleEditor/SimpleEditor.jsx b/app/components/SimpleEditor/SimpleEditor.jsx index c98aee5..145bfeb 100644 --- a/app/components/SimpleEditor/SimpleEditor.jsx +++ b/app/components/SimpleEditor/SimpleEditor.jsx @@ -77,7 +77,7 @@ export default class SimpleEditor extends React.Component { const exporter = new SimpleExporter(config) const convertedSource = exporter.exportDocument(source) - onSave(convertedSource) + return onSave(convertedSource) } // NOTE -- Theoretically, we shouldn't lock when the editor is in read only diff --git a/app/components/SimpleEditor/SimpleEditorWrapper.jsx b/app/components/SimpleEditor/SimpleEditorWrapper.jsx index a833c13..cba0a61 100644 --- a/app/components/SimpleEditor/SimpleEditorWrapper.jsx +++ b/app/components/SimpleEditor/SimpleEditorWrapper.jsx @@ -73,14 +73,13 @@ export class SimpleEditorWrapper extends React.Component { const { fragment } = this.props fragment.source = source - this.update(fragment) - // return callback() + return this.update(fragment) } update (newChapter) { const { book } = this.props const { updateFragment } = this.props.actions - updateFragment(book, newChapter) + return updateFragment(book, newChapter) } } -- GitLab