fe2142ba49
* Fix Newly-uploaded thumbnail stays blank * Fix ChannelThumbnail fallback broken * Hide earnings for pending
37 lines
1.1 KiB
JavaScript
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);
|