filtered homepage. other updates.

This commit is contained in:
Akinwale Ariwodola 2019-10-17 06:29:50 +01:00
parent 48030a97f2
commit d5f6d494a4
7 changed files with 38 additions and 20 deletions

View file

@ -12,7 +12,7 @@ import claimListStyle from 'styles/claimList';
import discoverStyle from 'styles/discover'; import discoverStyle from 'styles/discover';
import moment from 'moment'; import moment from 'moment';
const horizontalLimit = 7; const horizontalLimit = 10;
const softLimit = 500; const softLimit = 500;
class ClaimList extends React.PureComponent { class ClaimList extends React.PureComponent {

View file

@ -10,13 +10,15 @@ import {
makeSelectClaimIsNsfw, makeSelectClaimIsNsfw,
makeSelectShortUrlForUri, makeSelectShortUrlForUri,
} from 'lbry-redux'; } from 'lbry-redux';
import { selectRewardContentClaimIds } from 'lbryinc'; import { selectBlackListedOutpoints, selectFilteredOutpoints, selectRewardContentClaimIds } from 'lbryinc';
import { selectShowNsfw } from 'redux/selectors/settings'; import { selectShowNsfw } from 'redux/selectors/settings';
import FileItem from './view'; import FileItem from './view';
const select = (state, props) => ({ const select = (state, props) => ({
blackListedOutpoints: selectBlackListedOutpoints(state),
claim: makeSelectClaimForUri(props.uri)(state), claim: makeSelectClaimForUri(props.uri)(state),
fileInfo: makeSelectFileInfoForUri(props.uri)(state), fileInfo: makeSelectFileInfoForUri(props.uri)(state),
filteredOutpoints: selectFilteredOutpoints(state),
metadata: makeSelectMetadataForUri(props.uri)(state), metadata: makeSelectMetadataForUri(props.uri)(state),
rewardedContentClaimIds: selectRewardContentClaimIds(state), rewardedContentClaimIds: selectRewardContentClaimIds(state),
isResolvingUri: makeSelectIsUriResolving(props.uri)(state), isResolvingUri: makeSelectIsUriResolving(props.uri)(state),

View file

@ -40,10 +40,12 @@ class FileItem extends React.PureComponent {
render() { render() {
const { const {
blackListedOutpoints,
claim, claim,
title, title,
thumbnail, thumbnail,
fileInfo, fileInfo,
filteredOutpoints,
metadata, metadata,
isResolvingUri, isResolvingUri,
rewardedContentClaimIds, rewardedContentClaimIds,
@ -58,7 +60,17 @@ class FileItem extends React.PureComponent {
} = this.props; } = this.props;
if (claim && claim.value_type === 'channel') { if (claim && claim.value_type === 'channel') {
// don't display channels in the lists on the Explore page // don't display channels in the lists on the Your tags page
return null;
}
let shouldHide = false;
if (blackListedOutpoints || filteredOutpoints) {
const outpointsToHide = blackListedOutpoints.concat(filteredOutpoints);
shouldHide = outpointsToHide.some(outpoint => outpoint.txid === claim.txid && outpoint.nout === claim.nout);
}
if (shouldHide) {
// don't display blacklisted or filtered outpoints on the Your tags page
return null; return null;
} }

View file

@ -53,7 +53,6 @@ import thunk from 'redux-thunk';
const globalExceptionHandler = (error, isFatal) => { const globalExceptionHandler = (error, isFatal) => {
if (error && NativeModules.Firebase) { if (error && NativeModules.Firebase) {
console.log(error);
NativeModules.Firebase.logException(isFatal, error.message ? error.message : 'No message', JSON.stringify(error)); NativeModules.Firebase.logException(isFatal, error.message ? error.message : 'No message', JSON.stringify(error));
} }
}; };

View file

@ -94,10 +94,14 @@ class FirstRunScreen extends React.PureComponent {
Lbry.wallet_status().then(status => { Lbry.wallet_status().then(status => {
// unlock the wallet // unlock the wallet
if (status.is_locked) { if (status.is_locked) {
Lbry.wallet_unlock({ password: this.state.walletPassword ? this.state.walletPassword : '' }) Lbry.wallet_unlock({ password: this.state.walletPassword ? this.state.walletPassword : '' }).then(
.then(() => this.closeFinalPage()) unlocked => {
.catch(err => if (unlocked) {
notify({ message: 'The wallet could not be unlocked at this time. Please restart the app.' }) this.closeFinalPage();
} else {
notify({ message: 'The wallet could not be unlocked at this time. Please restart the app.' });
}
}
); );
} else { } else {
// wallet not locked. close final page // wallet not locked. close final page

View file

@ -110,13 +110,10 @@ class SplashScreen extends React.PureComponent {
doPreferenceGet( doPreferenceGet(
'shared', 'shared',
preference => { preference => {
console.log('***');
console.log(preference);
populateSharedUserState(preference); populateSharedUserState(preference);
}, },
error => { error => {
/* failed */ /* failed */
console.log(error);
} }
); );
}; };
@ -192,15 +189,17 @@ class SplashScreen extends React.PureComponent {
}); });
// unlock the wallet and then finish the splash screen // unlock the wallet and then finish the splash screen
Lbry.wallet_unlock({ password: password || '' }) Lbry.wallet_unlock({ password: password || '' }).then(unlocked => {
.then(() => { if (unlocked) {
this.setState({ this.setState({
message: testingNetwork, message: testingNetwork,
details: waitingForResolution, details: waitingForResolution,
}); });
this.finishSplashScreen(); this.finishSplashScreen();
}) } else {
.catch(() => this.handleAccountUnlockFailed()); this.handleAccountUnlockFailed();
}
});
} else { } else {
this.setState({ this.setState({
message: testingNetwork, message: testingNetwork,

View file

@ -81,12 +81,14 @@ class SyncVerifyPage extends React.PureComponent {
// unlock the wallet (if locked) // unlock the wallet (if locked)
Lbry.wallet_status().then(status => { Lbry.wallet_status().then(status => {
if (status.is_locked) { if (status.is_locked) {
Lbry.wallet_unlock({ password: this.state.password ? this.state.password : '' }) Lbry.wallet_unlock({ password: this.state.password ? this.state.password : '' }).then(unlocked => {
.then(() => navigation.goBack()) if (unlocked) {
.catch(err => { navigation.goBack();
} else {
if (notifyUnlockFailed) { if (notifyUnlockFailed) {
notify({ message: 'The wallet could not be unlocked at this time. Please restart the app.' }); notify({ message: 'The wallet could not be unlocked at this time. Please restart the app.' });
} }
}
}); });
} else { } else {
navigation.goBack(); navigation.goBack();