Off screen edited posts no longer show up as new posts (#4485)

Этот коммит содержится в:
Joram Wilander
2016-11-14 07:38:05 -05:00
коммит произвёл Christopher Speller
родитель 602f85d2ef
Коммит a25ae8fed2
2 изменённых файлов: 4 добавлений и 4 удалений

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

@@ -180,7 +180,7 @@ function handleNewPostEvent(msg) {
function handlePostEditEvent(msg) {
// Store post
const post = JSON.parse(msg.data.post);
PostStore.storePost(post);
PostStore.storePost(post, false);
PostStore.emitChange();
// Update channel state

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

@@ -245,7 +245,7 @@ class PostStoreClass extends EventEmitter {
this.postsInfo[id].postList = combinedPosts;
}
storePost(post) {
storePost(post, isNewPost = false) {
const postList = makePostListNonNull(this.getAllPosts(post.channel_id));
if (post.pending_post_id !== '') {
@@ -255,7 +255,7 @@ class PostStoreClass extends EventEmitter {
post.pending_post_id = '';
postList.posts[post.id] = post;
if (postList.order.indexOf(post.id) === -1) {
if (isNewPost && postList.order.indexOf(post.id) === -1) {
postList.order.unshift(post.id);
}
@@ -629,7 +629,7 @@ PostStore.dispatchToken = AppDispatcher.register((payload) => {
PostStore.emitChange();
break;
case ActionTypes.RECEIVED_POST:
PostStore.storePost(action.post);
PostStore.storePost(action.post, true);
PostStore.emitChange();
break;
case ActionTypes.RECEIVED_EDIT_POST: