Fixed issues in StatusLikes, StatusReposts, made own pages

• Fixed:
- issues in StatusLikes, StatusReposts, made own pages
This commit is contained in:
mgabdev
2020-08-20 15:11:39 -05:00
parent 5cb539061b
commit eeb0fdcd47
3 changed files with 30 additions and 26 deletions

View File

@@ -14,14 +14,14 @@ import ScrollableList from '../components/scrollable_list'
class StatusReposts extends ImmutablePureComponent {
componentWillMount () {
this.props.dispatch(fetchReposts(this.props.params.statusId))
this.props.dispatch(fetchStatus(this.props.params.statusId))
this.props.dispatch(fetchReposts(this.props.statusId))
this.props.dispatch(fetchStatus(this.props.statusId))
}
componentWillReceiveProps(nextProps) {
if (nextProps.params.statusId !== this.props.params.statusId && nextProps.params.statusId) {
this.props.dispatch(fetchReposts(nextProps.params.statusId))
this.props.dispatch(fetchStatus(nextProps.params.statusId))
if (nextProps.statusId !== this.props.statusId && nextProps.statusId) {
this.props.dispatch(fetchReposts(nextProps.statusId))
this.props.dispatch(fetchStatus(nextProps.statusId))
}
}
@@ -51,23 +51,26 @@ class StatusReposts extends ImmutablePureComponent {
}
const mapStateToProps = (state, props) => {
const statusId = props.params ? props.params.statusId : props.statusId
const getStatus = makeGetStatus()
const status = getStatus(state, {
id: props.params.statusId,
username: props.params.username,
id: statusId,
// username: props.params.username,
})
return {
status,
accountIds: state.getIn(['user_lists', 'reblogged_by', props.params.statusId]),
statusId,
accountIds: state.getIn(['user_lists', 'reblogged_by', statusId]),
}
}
StatusReposts.propTypes = {
params: PropTypes.object.isRequired,
dispatch: PropTypes.func.isRequired,
accountIds: ImmutablePropTypes.list,
dispatch: PropTypes.func.isRequired,
status: ImmutablePropTypes.map,
statusId: PropTypes.string.isRequired,
}
export default connect(mapStateToProps)(StatusReposts)