diff options
author | samogot <samogot@gmail.com> | 2016-05-25 23:13:04 +0300 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2016-05-25 16:13:04 -0400 |
commit | d31c972a438e7e9ccc8487f519a915423cb6b93b (patch) | |
tree | bf7c535cbb41c75b97d24b85d9f1903605f6d96d /webapp/components/post.jsx | |
parent | dd18b98b0b8c6dfd3011e527367844e8af920edb (diff) | |
download | chat-d31c972a438e7e9ccc8487f519a915423cb6b93b.tar.gz chat-d31c972a438e7e9ccc8487f519a915423cb6b93b.tar.bz2 chat-d31c972a438e7e9ccc8487f519a915423cb6b93b.zip |
PLT-1042 allow cancel pending post (#3053)
Diffstat (limited to 'webapp/components/post.jsx')
-rw-r--r-- | webapp/components/post.jsx | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/webapp/components/post.jsx b/webapp/components/post.jsx index 084fb9171..2b28d442c 100644 --- a/webapp/components/post.jsx +++ b/webapp/components/post.jsx @@ -4,14 +4,9 @@ import PostHeader from './post_header.jsx'; import PostBody from './post_body.jsx'; -import PostStore from 'stores/post_store.jsx'; -import ChannelStore from 'stores/channel_store.jsx'; - import Constants from 'utils/constants.jsx'; const ActionTypes = Constants.ActionTypes; -import Client from 'utils/web_client.jsx'; -import * as AsyncClient from 'utils/async_client.jsx'; import * as Utils from 'utils/utils.jsx'; import AppDispatcher from '../dispatcher/app_dispatcher.jsx'; @@ -23,7 +18,6 @@ export default class Post extends React.Component { this.handleCommentClick = this.handleCommentClick.bind(this); this.forceUpdateInfo = this.forceUpdateInfo.bind(this); - this.retryPost = this.retryPost.bind(this); this.state = {}; } @@ -44,36 +38,6 @@ export default class Post extends React.Component { this.refs.info.forceUpdate(); this.refs.header.forceUpdate(); } - retryPost(e) { - e.preventDefault(); - - var post = this.props.post; - Client.createPost(post, - (data) => { - AsyncClient.getPosts(); - - var channel = ChannelStore.get(post.channel_id); - var member = ChannelStore.getMember(post.channel_id); - member.msg_count = channel.total_msg_count; - member.last_viewed_at = Utils.getTimestamp(); - ChannelStore.setChannelMember(member); - - AppDispatcher.handleServerAction({ - type: ActionTypes.RECEIVED_POST, - post: data - }); - }, - () => { - post.state = Constants.POST_FAILED; - PostStore.updatePendingPost(post); - this.forceUpdate(); - } - ); - - post.state = Constants.POST_LOADING; - PostStore.updatePendingPost(post); - this.forceUpdate(); - } shouldComponentUpdate(nextProps) { if (!Utils.areObjectsEqual(nextProps.post, this.props.post)) { return true; @@ -245,7 +209,6 @@ export default class Post extends React.Component { parentPost={parentPost} posts={posts} handleCommentClick={this.handleCommentClick} - retryPost={this.retryPost} compactDisplay={this.props.compactDisplay} /> </div> |