diff --git a/app/components/post/post.js b/app/components/post/post.js index 2c312286a..005bc793a 100644 --- a/app/components/post/post.js +++ b/app/components/post/post.js @@ -133,7 +133,7 @@ class Post extends PureComponent { handlePostDelete = () => { const {formatMessage} = this.props.intl; - const {post, actions} = this.props; + const {actions, currentUserId, post} = this.props; Alert.alert( formatMessage({id: 'mobile.post.delete_title', defaultMessage: 'Delete Post'}), @@ -147,6 +147,9 @@ class Post extends PureComponent { onPress: () => { this.editDisableAction.cancel(); actions.deletePost(post); + if (post.user_id === currentUserId) { + actions.removePost(post); + } } }] ); diff --git a/app/screens/thread/thread.js b/app/screens/thread/thread.js index 9c9d90e78..0c538ca4c 100644 --- a/app/screens/thread/thread.js +++ b/app/screens/thread/thread.js @@ -47,6 +47,11 @@ class Thread extends PureComponent { } componentWillReceiveProps(nextProps) { + if (this.props.postIds !== nextProps.postIds && !nextProps.postIds.length) { + this.props.navigator.pop(); + return; + } + if (!this.state.lastViewedAt) { this.setState({lastViewedAt: nextProps.myMember.last_viewed_at}); }