fix filter selectors getting stuck #35

Merged
akinwale merged 1 commit from filter-selectors into master 2019-08-26 23:17:19 +02:00
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 })}>