diff options
author | enahum <nahumhbl@gmail.com> | 2016-06-09 15:28:57 -0300 |
---|---|---|
committer | Corey Hulen <corey@hulen.com> | 2016-06-09 11:28:57 -0700 |
commit | 18c53e03ebaf1021c5b8429ef7bce09e5de0c4a6 (patch) | |
tree | ccaa7bd967f50d005e517401abcfc59536fa18c9 /webapp/actions | |
parent | f1eefd99e6e40621ace005afcb1c08c6a69a744e (diff) | |
download | chat-18c53e03ebaf1021c5b8429ef7bce09e5de0c4a6.tar.gz chat-18c53e03ebaf1021c5b8429ef7bce09e5de0c4a6.tar.bz2 chat-18c53e03ebaf1021c5b8429ef7bce09e5de0c4a6.zip |
PLT-3221 Remove async call to get posts when creating a comment and editing a post (#3300)
PLT-3203 Commenting on the RHS while in permalink view makes the message not show up in the RHS
Diffstat (limited to 'webapp/actions')
-rw-r--r-- | webapp/actions/global_actions.jsx | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/webapp/actions/global_actions.jsx b/webapp/actions/global_actions.jsx index 0b264a9b3..ca3bf6362 100644 --- a/webapp/actions/global_actions.jsx +++ b/webapp/actions/global_actions.jsx @@ -134,6 +134,7 @@ export function doFocusPost(channelId, postId, data) { AppDispatcher.handleServerAction({ type: ActionTypes.RECEIVED_FOCUSED_POST, postId, + channelId, post_list: data }); AsyncClient.getChannels(true); @@ -208,25 +209,25 @@ export function emitPostFocusRightHandSideFromSearch(post, isMentionSearch) { export function emitLoadMorePostsEvent() { const id = ChannelStore.getCurrentId(); - loadMorePostsTop(id); + loadMorePostsTop(id, false); } export function emitLoadMorePostsFocusedTopEvent() { const id = PostStore.getFocusedPostId(); - loadMorePostsTop(id); + loadMorePostsTop(id, true); } -export function loadMorePostsTop(id) { +export function loadMorePostsTop(id, isFocusPost) { const earliestPostId = PostStore.getEarliestPost(id).id; if (PostStore.requestVisibilityIncrease(id, Constants.POST_CHUNK_SIZE)) { - AsyncClient.getPostsBefore(earliestPostId, 0, Constants.POST_CHUNK_SIZE); + AsyncClient.getPostsBefore(earliestPostId, 0, Constants.POST_CHUNK_SIZE, isFocusPost); } } export function emitLoadMorePostsFocusedBottomEvent() { const id = PostStore.getFocusedPostId(); const latestPostId = PostStore.getLatestPost(id).id; - AsyncClient.getPostsAfter(latestPostId, 0, Constants.POST_CHUNK_SIZE); + AsyncClient.getPostsAfter(latestPostId, 0, Constants.POST_CHUNK_SIZE, !!id); } export function emitPostRecievedEvent(post, msg) { @@ -259,6 +260,13 @@ export function emitUserPostedEvent(post) { }); } +export function emitUserCommentedEvent(post) { + AppDispatcher.handleServerAction({ + type: ActionTypes.CREATE_COMMENT, + post + }); +} + export function emitPostDeletedEvent(post) { AppDispatcher.handleServerAction({ type: ActionTypes.POST_DELETED, |