From a1b97bad924e4b62a742d438c5f4f2fc506bd7b6 Mon Sep 17 00:00:00 2001 From: Alf Eaton <eaton.alf@gmail.com> Date: Thu, 23 Feb 2017 13:36:25 +0000 Subject: [PATCH] Fetch the fragments for this book --- app/components/SimpleEditor/SimpleEditorWrapper.jsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/components/SimpleEditor/SimpleEditorWrapper.jsx b/app/components/SimpleEditor/SimpleEditorWrapper.jsx index cba0a61..960457e 100644 --- a/app/components/SimpleEditor/SimpleEditorWrapper.jsx +++ b/app/components/SimpleEditor/SimpleEditorWrapper.jsx @@ -17,10 +17,12 @@ export class SimpleEditorWrapper extends React.Component { } componentWillMount () { - const { getCollections, getFragments } = this.props.actions + const { book, actions } = this.props + const { getCollections, getFragments } = actions - getCollections().then(result => { - getFragments(result.collections[0]) + // TODO: might not need to fetch all the collections? + getCollections().then(() => { + getFragments(book) }) const { user } = this.props -- GitLab