Merge pull request #35 from lbryio/filter-selectors

fix filter selectors getting stuck
This commit is contained in:
Akinwale Ariwodola 2019-08-26 22:17:18 +01:00 committed by GitHub
commit 0c06f478c8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 4 deletions

View file

@ -71,7 +71,7 @@ class ClaimList extends React.PureComponent {
} }
buildClaimSearchOptions() { buildClaimSearchOptions() {
const { orderBy = Constants.DEFAULT_ORDER_BY, channelIds, showNsfwContent, tags, time } = this.props; const { orderBy, channelIds, showNsfwContent, tags, time } = this.props;
const { currentPage, subscriptionsView } = this.state; const { currentPage, subscriptionsView } = this.state;
const options = { const options = {

View file

@ -45,9 +45,12 @@ class TrendingPage extends React.PureComponent {
} }
onComponentFocused = () => { onComponentFocused = () => {
const { pushDrawerStack, setPlayerVisible, navigation } = this.props; const { pushDrawerStack, setPlayerVisible, navigation, sortByItem } = this.props;
const { filterForTags } = navigation.state.params ? navigation.state.params : { filterForTags: false }; const { filterForTags } = navigation.state.params ? navigation.state.params : { filterForTags: false };
this.setState({ currentTrendingForItem: TRENDING_FOR_ITEMS[filterForTags ? 1 : 0] }); this.setState({
currentTrendingForItem: TRENDING_FOR_ITEMS[filterForTags ? 1 : 0],
orderBy: getOrderBy(sortByItem),
});
pushDrawerStack(Constants.DRAWER_ROUTE_TRENDING, navigation.state.params); pushDrawerStack(Constants.DRAWER_ROUTE_TRENDING, navigation.state.params);
setPlayerVisible(); setPlayerVisible();
NativeModules.Firebase.setCurrentScreen('All content'); NativeModules.Firebase.setCurrentScreen('All content');
@ -110,7 +113,7 @@ class TrendingPage extends React.PureComponent {
<Icon style={discoverStyle.tagSortIcon} name={'sort-down'} size={14} /> <Icon style={discoverStyle.tagSortIcon} name={'sort-down'} size={14} />
</TouchableOpacity> </TouchableOpacity>
{sortByTop && <Text style={discoverStyle.pickerLabel}>in the</Text>} {sortByTop && <Text style={discoverStyle.pickerLabel}>from</Text>}
{sortByTop && ( {sortByTop && (
<TouchableOpacity style={discoverStyle.tagTime} onPress={() => this.setState({ showTimePicker: true })}> <TouchableOpacity style={discoverStyle.tagTime} onPress={() => this.setState({ showTimePicker: true })}>