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 moment from 'moment';
const horizontalLimit = 7;
const horizontalLimit = 10;
const softLimit = 500;
class ClaimList extends React.PureComponent {

View file

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

View file

@ -40,10 +40,12 @@ class FileItem extends React.PureComponent {
render() {
const {
blackListedOutpoints,
claim,
title,
thumbnail,
fileInfo,
filteredOutpoints,
metadata,
isResolvingUri,
rewardedContentClaimIds,
@ -58,7 +60,17 @@ class FileItem extends React.PureComponent {
} = this.props;
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;
}

View file

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

View file

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

View file

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

View file

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