lbry-desktop/ui/page/channels/index.js
saltrafael fe2142ba49
Thumbnail fixes (#6969)
* Fix Newly-uploaded thumbnail stays blank

* Fix ChannelThumbnail fallback broken

* Hide earnings for pending
2021-08-26 10:51:53 -04:00

37 lines
1.1 KiB
JavaScript

import { connect } from 'react-redux';
import {
selectMyChannelClaims,
selectMyChannelUrls,
doFetchChannelListMine,
selectFetchingMyChannels,
makeSelectClaimIsPending,
} from 'lbry-redux';
import { doSetActiveChannel } from 'redux/actions/app';
import { selectYoutubeChannels } from 'redux/selectors/user';
import ChannelsPage from './view';
const select = (state) => {
const channelUrls = selectMyChannelUrls(state);
let pendingChannels = [];
if (channelUrls) {
channelUrls.map((channelUrl) => {
const isPendingUrl = makeSelectClaimIsPending(channelUrl)(state);
if (isPendingUrl) pendingChannels.push(channelUrl);
});
}
return {
channelUrls,
channels: selectMyChannelClaims(state),
fetchingChannels: selectFetchingMyChannels(state),
youtubeChannels: selectYoutubeChannels(state),
pendingChannels,
};
};
const perform = (dispatch) => ({
fetchChannelListMine: () => dispatch(doFetchChannelListMine()),
doSetActiveChannel: (claimId) => dispatch(doSetActiveChannel(claimId)),
});
export default connect(select, perform)(ChannelsPage);