about summary refs log tree commit diff
path: root/app/assets/javascripts/components/containers
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2016-09-04 14:04:26 +0200
committerEugen Rochko <eugen@zeonfederated.com>2016-09-04 14:04:26 +0200
commit1022d682dc915bcbf3076c0280f29472068830bb (patch)
tree6ede8a3c1cb66e175efcd56af347dc2931806284 /app/assets/javascripts/components/containers
parent7939a216ff5cc7ac6bb30e850a21355f04fdebe5 (diff)
Normalized data in Redux, fix for asset URLs when rendered outside request
Diffstat (limited to 'app/assets/javascripts/components/containers')
-rw-r--r--app/assets/javascripts/components/containers/status_list_container.jsx14
1 files changed, 13 insertions, 1 deletions
diff --git a/app/assets/javascripts/components/containers/status_list_container.jsx b/app/assets/javascripts/components/containers/status_list_container.jsx
index cc6333a81..743e56c67 100644
--- a/app/assets/javascripts/components/containers/status_list_container.jsx
+++ b/app/assets/javascripts/components/containers/status_list_container.jsx
@@ -3,9 +3,21 @@ import StatusList            from '../components/status_list';
 import { replyCompose }      from '../actions/compose';
 import { reblog, favourite } from '../actions/interactions';
 
+function selectStatus(state, id) {
+  let status = state.getIn(['timelines', 'statuses', id]);
+
+  status = status.set('account', state.getIn(['timelines', 'accounts', status.get('account')]));
+
+  if (status.get('reblog') !== null) {
+    status = status.set('reblog', selectStatus(state, status.get('reblog')));
+  }
+
+  return status;
+};
+
 const mapStateToProps = function (state, props) {
   return {
-    statuses: state.getIn(['timelines', props.type])
+    statuses: state.getIn(['timelines', props.type]).map(id => selectStatus(state, id))
   };
 };