Misc tweaks and fixes (#13)
* channel icon auto thumbs. fix infinite claim list reload. * tweak last page check * additional tweaks and fixes before release
This commit is contained in:
parent
89222bc9ee
commit
38618080a1
23 changed files with 212 additions and 119 deletions
|
@ -6,6 +6,7 @@ import {
|
|||
makeSelectFileInfoForUri,
|
||||
makeSelectIsUriResolving,
|
||||
makeSelectClaimIsNsfw,
|
||||
makeSelectShortUrlForUri,
|
||||
makeSelectTitleForUri,
|
||||
makeSelectThumbnailForUri,
|
||||
} from 'lbry-redux';
|
||||
|
@ -23,6 +24,7 @@ const select = (state, props) => ({
|
|||
nsfw: makeSelectClaimIsNsfw(props.uri)(state),
|
||||
isResolvingUri: makeSelectIsUriResolving(props.uri)(state),
|
||||
obscureNsfw: !selectShowNsfw(state),
|
||||
shortUrl: makeSelectShortUrlForUri(props.uri)(state),
|
||||
title: makeSelectTitleForUri(props.uri)(state),
|
||||
thumbnail: makeSelectThumbnailForUri(props.uri)(state),
|
||||
});
|
||||
|
|
|
@ -42,8 +42,8 @@ class FileListItem extends React.PureComponent {
|
|||
}
|
||||
|
||||
defaultOnPress = () => {
|
||||
const { navigation, uri } = this.props;
|
||||
navigateToUri(navigation, uri);
|
||||
const { autoplay, navigation, uri, shortUrl } = this.props;
|
||||
navigateToUri(navigation, shortUrl || uri, { autoplay });
|
||||
};
|
||||
|
||||
render() {
|
||||
|
@ -70,7 +70,7 @@ class FileListItem extends React.PureComponent {
|
|||
const obscure = obscureNsfw && nsfw;
|
||||
const isResolving = !fileInfo && isResolvingUri;
|
||||
|
||||
let name, channel, height, channelClaimId, fullChannelUri, shouldHide, signingChannel;
|
||||
let name, channel, height, channelClaimId, fullChannelUri, shortChannelUri, shouldHide, signingChannel;
|
||||
if (claim) {
|
||||
name = claim.name;
|
||||
signingChannel = claim.signing_channel;
|
||||
|
@ -78,14 +78,18 @@ class FileListItem extends React.PureComponent {
|
|||
height = claim.height;
|
||||
channelClaimId = signingChannel ? signingChannel.claim_id : null;
|
||||
fullChannelUri = channelClaimId ? `${channel}#${channelClaimId}` : channel;
|
||||
shortChannelUri = signingChannel ? signingChannel.short_url : null;
|
||||
|
||||
if (blackListedOutpoints || filteredOutpoints) {
|
||||
const outpointsToHide = blackListedOutpoints.concat(filteredOutpoints);
|
||||
shouldHide = outpointsToHide.some(outpoint => outpoint.txid === claim.txid && outpoint.nout === claim.nout);
|
||||
}
|
||||
|
||||
// TODO: hide channels on tag pages?
|
||||
// shouldHide = 'channel' === claim.value_type;
|
||||
}
|
||||
|
||||
if (shouldHide || (featuredResult && !isResolvingUri && !claim && !title && !name)) {
|
||||
if (shouldHide || (!isResolvingUri && !claim) || (featuredResult && !isResolvingUri && !claim && !title && !name)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -130,7 +134,7 @@ class FileListItem extends React.PureComponent {
|
|||
style={fileListStyle.publisher}
|
||||
text={channel}
|
||||
onPress={() => {
|
||||
navigateToUri(navigation, normalizeURI(fullChannelUri));
|
||||
navigateToUri(navigation, normalizeURI(shortChannelUri || fullChannelUri));
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue