From f05181898bff17663a8aaf728e6a991f78163771 Mon Sep 17 00:00:00 2001 From: Akinwale Ariwodola Date: Sun, 11 Aug 2019 18:36:47 +0100 Subject: [PATCH] fix navigate back to trending and claim_search end detection --- src/component/AppNavigator.js | 2 +- src/component/claimList/view.js | 4 ++-- src/constants.js | 1 - src/utils/helper.js | 10 +++++----- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/component/AppNavigator.js b/src/component/AppNavigator.js index 02523a0..4530686 100644 --- a/src/component/AppNavigator.js +++ b/src/component/AppNavigator.js @@ -137,7 +137,7 @@ const drawer = createDrawerNavigator( drawerIcon: ({ tintColor }) => , }, }, - TrendingStack: { + Trending: { screen: TrendingPage, navigationOptions: { title: 'Trending', diff --git a/src/component/claimList/view.js b/src/component/claimList/view.js index 10911ca..ae96f4b 100644 --- a/src/component/claimList/view.js +++ b/src/component/claimList/view.js @@ -160,8 +160,8 @@ class ClaimList extends React.PureComponent { if ( this.state.lastPageReached || - (claimSearchUris && - (claimSearchUris.length < Constants.DEFAULT_PAGE_SIZE || claimSearchUris.length >= softLimit)) || + ((claimSearchUris.length > 0 && claimSearchUris.length < Constants.DEFAULT_PAGE_SIZE) || + claimSearchUris.length >= softLimit) || (uris && uris.length >= softLimit) ) { return; diff --git a/src/constants.js b/src/constants.js index 65343ea..21229a3 100644 --- a/src/constants.js +++ b/src/constants.js @@ -78,7 +78,6 @@ const Constants = { DRAWER_ROUTE_TAG: 'Tag', FULL_ROUTE_NAME_DISCOVER: 'DiscoverStack', - FULL_ROUTE_NAME_TRENDING: 'TrendingStack', FULL_ROUTE_NAME_WALLET: 'WalletStack', ROUTE_FILE: 'File', diff --git a/src/utils/helper.js b/src/utils/helper.js index 39fce4b..338bf31 100644 --- a/src/utils/helper.js +++ b/src/utils/helper.js @@ -11,19 +11,19 @@ function getRouteForSpecialUri(uri) { switch (page) { case Constants.PAGE_REWARDS: - targetRoute = 'Rewards'; + targetRoute = Constants.DRAWER_ROUTE_REWARDS; break; case Constants.PAGE_SETTINGS: - targetRoute = 'Settings'; + targetRoute = Constants.DRAWER_ROUTE_SETTINGS; break; case Constants.PAGE_TRENDING: - targetRoute = 'TrendingStack'; + targetRoute = Constants.DRAWER_ROUTE_TRENDING; break; case Constants.PAGE_WALLET: - targetRoute = 'WalletStack'; + targetRoute = Constants.FULL_ROUTE_NAME_WALLET; break; default: - targetRoute = 'DiscoverStack'; + targetRoute = Constants.FULL_ROUTE_NAME_DISCOVER; break; }