Update NewsFeed to use statusFeed url

pull/10616/head
Jared Scheib 2017-06-13 16:42:05 -07:00
parent b031dd5a78
commit c2f0af7e37
1 changed files with 5 additions and 7 deletions

View File

@ -44,34 +44,32 @@ class NewsFeed extends Component {
// TODO: implement interval polling a la AutoRefresh
componentDidMount() {
const {source, fetchJSONFeed} = this.props
const {statusFeedURL, fetchJSONFeed} = this.props
fetchJSONFeed(source.links.status)
fetchJSONFeed(statusFeedURL)
}
}
const {bool, func, shape, string} = PropTypes
NewsFeed.propTypes = {
source: shape({
links: shape({
status: string.isRequired,
}).isRequired,
}).isRequired,
hasCompletedFetchOnce: bool.isRequired,
isFetching: bool.isRequired,
isFailed: bool.isRequired,
data: shape(),
fetchJSONFeed: func.isRequired,
statusFeedURL: string,
}
const mapStateToProps = ({
links: {external: {statusFeed: statusFeedURL}},
JSONFeed: {hasCompletedFetchOnce, isFetching, isFailed, data},
}) => ({
hasCompletedFetchOnce,
isFetching,
isFailed,
data,
statusFeedURL,
})
const mapDispatchToProps = dispatch => ({