summaryrefslogtreecommitdiffstats
path: root/webapp/stores/post_store.jsx
diff options
context:
space:
mode:
Diffstat (limited to 'webapp/stores/post_store.jsx')
-rw-r--r--webapp/stores/post_store.jsx12
1 files changed, 6 insertions, 6 deletions
diff --git a/webapp/stores/post_store.jsx b/webapp/stores/post_store.jsx
index 903085760..3f2f75796 100644
--- a/webapp/stores/post_store.jsx
+++ b/webapp/stores/post_store.jsx
@@ -96,7 +96,7 @@ class PostStoreClass extends EventEmitter {
let post = null;
if (posts.posts.hasOwnProperty(postId)) {
- post = Object.assign({}, posts.posts[postId]);
+ post = posts.posts[postId];
}
return post;
@@ -104,7 +104,7 @@ class PostStoreClass extends EventEmitter {
getAllPosts(id) {
if (this.postsInfo.hasOwnProperty(id)) {
- return Object.assign({}, this.postsInfo[id].postList);
+ return this.postsInfo[id].postList;
}
return null;
@@ -406,7 +406,7 @@ class PostStoreClass extends EventEmitter {
let posts;
let pendingPosts;
for (const k in this.postsInfo) {
- if (this.postsInfo[k].postList.posts.hasOwnProperty(this.selectedPostId)) {
+ if (this.postsInfo[k].postList && this.postsInfo[k].postList.posts.hasOwnProperty(this.selectedPostId)) {
posts = this.postsInfo[k].postList.posts;
if (this.postsInfo[k].pendingPosts != null) {
pendingPosts = this.postsInfo[k].pendingPosts.posts;
@@ -495,7 +495,7 @@ class PostStoreClass extends EventEmitter {
BrowserStore.actionOnGlobalItemsWithPrefix('draft_', (key, value) => {
if (value) {
value.uploadsInProgress = [];
- BrowserStore.setItem(key, value);
+ BrowserStore.setGlobalItem(key, value);
}
});
}
@@ -503,7 +503,7 @@ class PostStoreClass extends EventEmitter {
BrowserStore.actionOnGlobalItemsWithPrefix('comment_draft_', (key, value) => {
if (value) {
value.uploadsInProgress = [];
- BrowserStore.setItem(key, value);
+ BrowserStore.setGlobalItem(key, value);
}
});
}
@@ -531,8 +531,8 @@ PostStore.dispatchToken = AppDispatcher.register((payload) => {
switch (action.type) {
case ActionTypes.RECEIVED_POSTS: {
const id = PostStore.currentFocusedPostId == null ? action.id : PostStore.currentFocusedPostId;
- PostStore.checkBounds(id, action.numRequested, makePostListNonNull(action.post_list), action.before);
PostStore.storePosts(id, makePostListNonNull(action.post_list));
+ PostStore.checkBounds(id, action.numRequested, makePostListNonNull(action.post_list), action.before);
PostStore.emitChange();
break;
}