mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-12-14 07:08:44 +03:00
extra checks on search page
This commit is contained in:
parent
82675efb79
commit
8a32ff7388
@ -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,32 +46,35 @@ const OtherResult = ({ navigation, searchValue }) => {
|
||||
const _renderList = (users, tags, filterIndex, handleOnPress) => {
|
||||
switch (filterIndex) {
|
||||
case 0:
|
||||
return (
|
||||
<FlatList
|
||||
data={users}
|
||||
keyExtractor={(item) => item.id}
|
||||
renderItem={({ item, index }) => (
|
||||
<TouchableOpacity onPress={() => handleOnPress(item)}>
|
||||
{_renderUserItem(item, index)}
|
||||
</TouchableOpacity>
|
||||
)}
|
||||
ListEmptyComponent={_renderEmptyContent}
|
||||
/>
|
||||
);
|
||||
if (users && users.length > 0) {
|
||||
return (
|
||||
<FlatList
|
||||
data={users}
|
||||
keyExtractor={(item, ind) => `${item}-${ind}`}
|
||||
renderItem={({ item, index }) => (
|
||||
<TouchableOpacity onPress={() => handleOnPress(item)}>
|
||||
{_renderUserItem(item, index)}
|
||||
</TouchableOpacity>
|
||||
)}
|
||||
ListEmptyComponent={_renderEmptyContent}
|
||||
/>
|
||||
);
|
||||
}
|
||||
case 1:
|
||||
return (
|
||||
<FlatList
|
||||
data={tags}
|
||||
keyExtractor={(item) => item.id}
|
||||
renderItem={({ item, index }) => (
|
||||
<TouchableOpacity onPress={() => handleOnPress(item)}>
|
||||
{_renderTagItem(item, index)}
|
||||
</TouchableOpacity>
|
||||
)}
|
||||
ListEmptyComponent={_renderEmptyContent}
|
||||
/>
|
||||
);
|
||||
|
||||
if (tags && tags.length > 0) {
|
||||
return (
|
||||
<FlatList
|
||||
data={tags}
|
||||
keyExtractor={(item) => item.id}
|
||||
renderItem={({ item, index }) => (
|
||||
<TouchableOpacity onPress={() => handleOnPress(item)}>
|
||||
{_renderTagItem(item, index)}
|
||||
</TouchableOpacity>
|
||||
)}
|
||||
ListEmptyComponent={_renderEmptyContent}
|
||||
/>
|
||||
);
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user