fix search restore and background play bug

This commit is contained in:
Akinwale Ariwodola 2020-01-31 08:52:07 +01:00
parent 017787ef25
commit bf7f836465
2 changed files with 28 additions and 29 deletions

View file

@ -35,7 +35,7 @@ const perform = dispatch => ({
search: (query, from) => dispatch(doResolvedSearch(query, Constants.DEFAULT_PAGE_SIZE, from, false, {})),
claimSearch: options => dispatch(doClaimSearch(options)),
updateSearchQuery: query => dispatch(doUpdateSearchQuery(query)),
pushDrawerStack: () => dispatch(doPushDrawerStack(Constants.DRAWER_ROUTE_SEARCH)),
pushDrawerStack: (routeName, params) => dispatch(doPushDrawerStack(routeName, params)),
resolveUris: uris => dispatch(doResolveUris(uris)),
setPlayerVisible: () => dispatch(doSetPlayerVisible(false)),
});

View file

@ -52,9 +52,9 @@ class SearchPage extends React.PureComponent {
}
onComponentFocused = () => {
const { pushDrawerStack, setPlayerVisible, query, search } = this.props;
pushDrawerStack();
const { pushDrawerStack, setPlayerVisible, navigation, query, search } = this.props;
setPlayerVisible();
pushDrawerStack(Constants.DRAWER_ROUTE_SEARCH, navigation.state.params ? navigation.state.params : null);
NativeModules.Firebase.setCurrentScreen('Search').then(result => {
const searchQuery = query || this.getSearchQuery();
if (searchQuery && searchQuery.trim().length > 0) {
@ -221,7 +221,6 @@ class SearchPage extends React.PureComponent {
</View>
)}
{(!isSearching || this.state.currentFrom > 0) && (
<FlatList
extraData={this.state}
style={searchStyle.scrollContainer}
@ -246,7 +245,7 @@ class SearchPage extends React.PureComponent {
/>
)}
/>
)}
{this.state.currentFrom > 0 && isSearching && (
<View style={searchStyle.moreLoading}>
<ActivityIndicator size="small" color={Colors.NextLbryGreen} />