From e0efa7098ff9ea3ec243d84031bc266cfe1b7ed7 Mon Sep 17 00:00:00 2001 From: u-e Date: Wed, 27 Mar 2019 23:42:18 +0300 Subject: [PATCH] fixed draft post --- src/screens/editor/container/editorContainer.js | 4 ++-- src/screens/editor/screen/editorScreen.js | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/screens/editor/container/editorContainer.js b/src/screens/editor/container/editorContainer.js index ad49e8b43..70cd36ebf 100644 --- a/src/screens/editor/container/editorContainer.js +++ b/src/screens/editor/container/editorContainer.js @@ -279,8 +279,8 @@ class EditorContainer extends Component { _submitPost = async (fields) => { const { - navigation, currentAccount, pinCode, intl, isDefaultFooter -} = this.props; + navigation, currentAccount, pinCode, intl, isDefaultFooter, + } = this.props; if (currentAccount) { this.setState({ isPostSending: true }); diff --git a/src/screens/editor/screen/editorScreen.js b/src/screens/editor/screen/editorScreen.js index e29d39404..4af40c666 100644 --- a/src/screens/editor/screen/editorScreen.js +++ b/src/screens/editor/screen/editorScreen.js @@ -38,15 +38,16 @@ class EditorScreen extends Component { } // Component Life Cycles - componentWillReceiveProps = (nextProps) => { + componentWillReceiveProps = async (nextProps) => { const { draftPost, isUploading } = this.props; if (nextProps.draftPost && draftPost !== nextProps.draftPost) { - this.setState({ + await this.setState(prevState => ({ fields: { + ...prevState.fields, ...nextProps.draftPost, }, - }); + })); } if (isUploading !== nextProps) {