diff --git a/ui/page/channelsFollowing/index.js b/ui/page/channelsFollowing/index.js index 599cbf841..c08a2107f 100644 --- a/ui/page/channelsFollowing/index.js +++ b/ui/page/channelsFollowing/index.js @@ -1,13 +1,18 @@ import { connect } from 'react-redux'; import { SETTINGS } from 'lbry-redux'; +import { doFetchActiveLivestreams } from 'redux/actions/livestream'; +import { selectActiveLivestreams } from 'redux/selectors/livestream'; import { selectSubscriptions } from 'redux/selectors/subscriptions'; import { makeSelectClientSetting } from 'redux/selectors/settings'; import ChannelsFollowingPage from './view'; -const select = state => ({ +const select = (state) => ({ subscribedChannels: selectSubscriptions(state), tileLayout: makeSelectClientSetting(SETTINGS.TILE_LAYOUT)(state), + activeLivestreams: selectActiveLivestreams(state), }); -export default connect(select)(ChannelsFollowingPage); +export default connect(select, { + doFetchActiveLivestreams, +})(ChannelsFollowingPage); diff --git a/ui/page/channelsFollowing/view.jsx b/ui/page/channelsFollowing/view.jsx index 87bb5423f..c7f9d7222 100644 --- a/ui/page/channelsFollowing/view.jsx +++ b/ui/page/channelsFollowing/view.jsx @@ -10,21 +10,31 @@ import Page from 'component/page'; import Button from 'component/button'; import Icon from 'component/common/icon'; import { splitBySeparator } from 'lbry-redux'; +import { getLivestreamUris } from 'util/livestream'; type Props = { subscribedChannels: Array, tileLayout: boolean, + activeLivestreams: ?LivestreamInfo, + doFetchActiveLivestreams: () => void, }; function ChannelsFollowingPage(props: Props) { - const { subscribedChannels, tileLayout } = props; + const { subscribedChannels, tileLayout, activeLivestreams, doFetchActiveLivestreams } = props; + const hasSubsribedChannels = subscribedChannels.length > 0; + const channelIds = subscribedChannels.map((sub) => splitBySeparator(sub.uri)[1]); + + React.useEffect(() => { + doFetchActiveLivestreams(); + }, []); return !hasSubsribedChannels ? ( ) : ( } defaultOrderBy={CS.ORDER_BY_NEW} - channelIds={subscribedChannels.map((sub) => splitBySeparator(sub.uri)[1])} + channelIds={channelIds} meta={