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
Этот коммит содержится в:
enahum
2016-06-09 15:28:57 -03:00
коммит произвёл Corey Hulen
родитель f1eefd99e6
Коммит 18c53e03eb
6 изменённых файлов: 33 добавлений и 26 удалений

Просмотреть файл

@@ -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,