diff --git a/src/components/postView/container/postDisplayContainer.js b/src/components/postView/container/postDisplayContainer.js index aa4dc31f0..c1140ee72 100644 --- a/src/components/postView/container/postDisplayContainer.js +++ b/src/components/postView/container/postDisplayContainer.js @@ -48,6 +48,7 @@ class PostDisplayContainer extends Component { _handleOnReplyPress = () => { const { post, navigation } = this.props; + navigation.navigate({ routeName: ROUTES.SCREENS.EDITOR, params: { @@ -60,14 +61,20 @@ class PostDisplayContainer extends Component { _handleOnEditPress = () => { const { post, navigation } = this.props; - navigation.navigate({ - routeName: ROUTES.SCREENS.EDITOR, - params: { - isEdit: true, - post, - fetchPost: this._fetchPost, - }, - }); + + if (post) { + const isReply = post.parent_author; + + navigation.navigate({ + routeName: ROUTES.SCREENS.EDITOR, + params: { + isEdit: true, + isReply, + post, + fetchPost: this._fetchPost, + }, + }); + } }; _fetchPost = async () => { diff --git a/src/screens/editor/container/editorContainer.js b/src/screens/editor/container/editorContainer.js index 75fd2f474..3542c1951 100644 --- a/src/screens/editor/container/editorContainer.js +++ b/src/screens/editor/container/editorContainer.js @@ -274,9 +274,9 @@ class EditorContainer extends Component { }; _saveCurrentDraft = async (fields) => { - const { draftId, isReply } = this.state; + const { draftId, isReply, isEdit } = this.state; - if (!draftId) { + if (!draftId && !isEdit) { const { currentAccount } = this.props; const username = currentAccount && currentAccount.name ? currentAccount.name : ''; @@ -408,8 +408,8 @@ class EditorContainer extends Component { 0, ) .then(() => { - this._handleSubmitSuccess(); AsyncStorage.setItem('temp-reply', ''); + this._handleSubmitSuccess(); }) .catch((error) => { this._handleSubmitFailure(error); diff --git a/src/screens/profile/screen/profileStyles.js b/src/screens/profile/screen/profileStyles.js index d268553ba..743f4e945 100644 --- a/src/screens/profile/screen/profileStyles.js +++ b/src/screens/profile/screen/profileStyles.js @@ -53,11 +53,11 @@ export default EStyleSheet.create({ }, postTabBar: { backgroundColor: '$primaryBackgroundColor', + flex: 1, }, commentsTabBar: { backgroundColor: '$primaryBackgroundColor', paddingHorizontal: 16, paddingVertical: 5, }, - tabBarTitle: {}, });