diff --git a/app/components/BookBuilder/Chapter/UploadButton.jsx b/app/components/BookBuilder/Chapter/UploadButton.jsx index 3b233bee1fd04fd125b0a9c8b21e7ed7d72a2fe9..32846417e9f08208d1ec0a57fd27f8d99efc53d7 100644 --- a/app/components/BookBuilder/Chapter/UploadButton.jsx +++ b/app/components/BookBuilder/Chapter/UploadButton.jsx @@ -11,18 +11,17 @@ export class UploadButton extends React.Component { event.preventDefault() const file = event.target.files[0] - const { - chapter, - convertFile, - toggleUpload, - update - } = this.props + const { chapter, convertFile, toggleUpload, update } = this.props toggleUpload() convertFile(file).then(response => { - chapter.source = response.converted - update(chapter) + const patch = { + id: chapter.id, + source: response.converted + } + + update(patch) toggleUpload() }).catch((error) => { console.error('INK error', error)