Fixed issues in StatusLikes, StatusReposts, made own pages
• Fixed: - issues in StatusLikes, StatusReposts, made own pages
This commit is contained in:
@@ -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)
|
||||
Reference in New Issue
Block a user