fix search and related content #502

Merged
akinwale merged 1 commit from search-fix into master 2019-03-28 18:01:48 +01:00
5 changed files with 15 additions and 10 deletions
Showing only changes of commit 4d61462290 - Show all commits
app/src
component
relatedContent
uriBar
page/search

View file

@ -14,7 +14,7 @@ const select = (state, props) => ({
});
const perform = dispatch => ({
search: query => dispatch(doSearch(query, 10, undefined, true)),
search: query => dispatch(doSearch(query, 20, undefined, true)),
});
akinwale commented 2019-03-27 08:18:31 +01:00 (Migrated from github.com)
Review

So, funny story, if I set a different value from 20 here, no results are displayed for related content. The makeSelectRecommendedContentForUri selector needs to be updated to be able to handle different result counts. Something to be considered in the future.

So, funny story, if I set a different value from 20 here, no results are displayed for related content. The `makeSelectRecommendedContentForUri` selector needs to be updated to be able to handle different result counts. Something to be considered in the future.
neb-b commented 2019-03-27 20:29:34 +01:00 (Migrated from github.com)
Review

Ah that's not very good. I will look into it.

Ah that's not very good. I will look into it.
export default connect(

View file

@ -1,10 +1,10 @@
import React from 'react';
import { ActivityIndicator, FlatList, Text, View } from 'react-native';
import { navigateToUri } from '../../utils/helper';
import Colors from '../../styles/colors';
import FileListItem from '../fileListItem';
import fileListStyle from '../../styles/fileList';
import relatedContentStyle from '../../styles/relatedContent';
import { navigateToUri } from 'utils/helper';
import Colors from 'styles/colors';
import FileListItem from 'component/fileListItem';
import fileListStyle from 'styles/fileList';
import relatedContentStyle from 'styles/relatedContent';
export default class RelatedContent extends React.PureComponent<Props> {
constructor() {

View file

@ -9,7 +9,7 @@ import discoverStyle from 'styles/discover';
import uriBarStyle from 'styles/uriBar';
class UriBar extends React.PureComponent {
static INPUT_TIMEOUT = 500;
static INPUT_TIMEOUT = 1000; // 1 second
textInput = null;

View file

@ -1,9 +1,12 @@
import { connect } from 'react-redux';
import {
doSearch,
doUpdateSearchQuery,
makeSelectSearchUris,
selectIsSearching,
selectSearchValue
selectSearchValue,
makeSelectQueryWithOptions,
selectSearchUrisByQuery
} from 'lbry-redux';
import { doPushDrawerStack } from 'redux/actions/drawer';
import Constants from 'constants';
@ -12,11 +15,13 @@ import SearchPage from './view';
const select = (state) => ({
isSearching: selectIsSearching(state),
query: selectSearchValue(state),
uris: makeSelectSearchUris(selectSearchValue(state))(state)
uris: makeSelectSearchUris(makeSelectQueryWithOptions(null, 25)(state))(state),
urisByQuery: selectSearchUrisByQuery(state),
});
const perform = dispatch => ({
search: (query) => dispatch(doSearch(query, 25)),
updateSearchQuery: query => dispatch(doUpdateSearchQuery(query)),
pushDrawerStack: () => dispatch(doPushDrawerStack(Constants.DRAWER_ROUTE_SEARCH)),
});

View file

@ -45,7 +45,7 @@ class SearchPage extends React.PureComponent {
}
render() {
const { isSearching, navigation, query, uris } = this.props;
const { isSearching, navigation, query, uris, urisByQuery } = this.props;
const { searchQuery } = navigation.state.params;
return (