about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2017-02-02 00:45:57 +0100
committerEugen Rochko <eugen@zeonfederated.com>2017-02-02 00:49:25 +0100
commit17ae7d132cba105a857958e5b98c95f68f364e28 (patch)
treeb9395792346ed61bcaa0948b2e95ac3f26ca8a32
parentede04cdb2443fe87a30b393c8dd2a5973dc05770 (diff)
Prevent potential issue with public/hashtag statuses arriving after
they have been loaded and favourited/reblogged from another source

Since the status JSON returned from public/hashtag streams does not
contain favourited/reblogged attributes, merging them should not
override existing ones.
-rw-r--r--app/assets/javascripts/components/reducers/statuses.jsx2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/assets/javascripts/components/reducers/statuses.jsx b/app/assets/javascripts/components/reducers/statuses.jsx
index 084b6304c..6323e0fbe 100644
--- a/app/assets/javascripts/components/reducers/statuses.jsx
+++ b/app/assets/javascripts/components/reducers/statuses.jsx
@@ -46,7 +46,7 @@ const normalizeStatus = (state, status) => {
     status.reblog = status.reblog.id;
   }
 
-  return state.set(status.id, Immutable.fromJS(status));
+  return state.update(status.id, Immutable.Map(), map => map.mergeDeep(Immutable.fromJS(status)));
 };
 
 const normalizeStatuses = (state, statuses) => {