Normalized data in Redux, fix for asset URLs when rendered outside request
This commit is contained in:
@ -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))
|
||||
};
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user