Skip to content
Snippets Groups Projects
Commit 0a2427f7 authored by Eugen Rochko's avatar Eugen Rochko
Browse files

Fix #634 - Only include innermost-level statuses in report UI

Fix #635 - Include the initially-reported status in report UI even if it's not
among the user's most recent statuses
parent e571a018
No related branches found
No related tags found
No related merge requests found
......@@ -18,6 +18,10 @@ const StatusCheckBox = React.createClass({
const { status, checked, onToggle, disabled } = this.props;
const content = { __html: emojify(status.get('content')) };
if (status.get('reblog')) {
return null;
}
return (
<div className='status-check-box' style={{ display: 'flex' }}>
<div
......
......@@ -27,7 +27,7 @@ const makeMapStateToProps = () => {
isSubmitting: state.getIn(['reports', 'new', 'isSubmitting']),
account: getAccount(state, accountId),
comment: state.getIn(['reports', 'new', 'comment']),
statusIds: state.getIn(['timelines', 'accounts_timelines', accountId, 'items'], Immutable.List())
statusIds: Immutable.OrderedSet(state.getIn(['timelines', 'accounts_timelines', accountId, 'items'])).union(state.getIn(['reports', 'new', 'status_ids']))
};
};
......
......@@ -25,10 +25,10 @@ export default function reports(state = initialState, action) {
map.setIn(['new', 'account_id'], action.account.get('id'));
if (state.getIn(['new', 'account_id']) !== action.account.get('id')) {
map.setIn(['new', 'status_ids'], action.status ? Immutable.Set([action.status.get('id')]) : Immutable.Set());
map.setIn(['new', 'status_ids'], action.status ? Immutable.Set([action.status.getIn(['reblog', 'id'], action.status.get('id'))]) : Immutable.Set());
map.setIn(['new', 'comment'], '');
} else {
map.updateIn(['new', 'status_ids'], Immutable.Set(), set => set.add(action.status.get('id')));
map.updateIn(['new', 'status_ids'], Immutable.Set(), set => set.add(action.status.getIn(['reblog', 'id'], action.status.get('id'))));
}
});
case REPORT_STATUS_TOGGLE:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment