extra checks on search page

This commit is contained in:
feruz 2020-12-03 16:05:11 +02:00
parent 82675efb79
commit 8a32ff7388
4 changed files with 32 additions and 31 deletions
src
providers
screens/searchResult

View File

@ -24,9 +24,6 @@ export const getCurrencyTokenRate = (currency, token) =>
.catch((err) => {
bugsnag.notify(err);
return 0;
/*token === 'hbd'
? getCurrencyTokenRate(currency, 'sbd')
: getCurrencyTokenRate(currency, 'steem');*/
});
/**

View File

@ -1099,8 +1099,8 @@ export const lookupAccounts = async (username) => {
export const getTrendingTags = async (tag) => {
try {
const users = await client.database.call('get_trending_tags', [tag, 20]);
return users;
const tags = await client.database.call('get_trending_tags', [tag, 20]);
return tags;
} catch (error) {
console.log('get_trending_tags');
throw error;

View File

@ -28,7 +28,8 @@ const OtherResultContainer = (props) => {
});
} else {
getLeaderboard().then((result) => {
setUsers(result.map((item) => item._id));
const sos = result.map((item) => item._id);
setUsers(sos);
});
}
}, [searchValue]);

View File

@ -46,10 +46,11 @@ const OtherResult = ({ navigation, searchValue }) => {
const _renderList = (users, tags, filterIndex, handleOnPress) => {
switch (filterIndex) {
case 0:
if (users && users.length > 0) {
return (
<FlatList
data={users}
keyExtractor={(item) => item.id}
keyExtractor={(item, ind) => `${item}-${ind}`}
renderItem={({ item, index }) => (
<TouchableOpacity onPress={() => handleOnPress(item)}>
{_renderUserItem(item, index)}
@ -58,7 +59,9 @@ const OtherResult = ({ navigation, searchValue }) => {
ListEmptyComponent={_renderEmptyContent}
/>
);
}
case 1:
if (tags && tags.length > 0) {
return (
<FlatList
data={tags}
@ -71,7 +74,7 @@ const OtherResult = ({ navigation, searchValue }) => {
ListEmptyComponent={_renderEmptyContent}
/>
);
}
default:
break;
}