mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-12-15 00:23:34 +03:00
extra checks on search page
This commit is contained in:
parent
82675efb79
commit
8a32ff7388
src
providers
screens/searchResult
@ -24,9 +24,6 @@ export const getCurrencyTokenRate = (currency, token) =>
|
||||
.catch((err) => {
|
||||
bugsnag.notify(err);
|
||||
return 0;
|
||||
/*token === 'hbd'
|
||||
? getCurrencyTokenRate(currency, 'sbd')
|
||||
: getCurrencyTokenRate(currency, 'steem');*/
|
||||
});
|
||||
|
||||
/**
|
||||
|
@ -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;
|
||||
|
@ -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]);
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user