Fixed inconsistent search in emojiboard.

Signed-off-by: Ajay Bura <ajbura@gmail.com>
This commit is contained in:
Ajay Bura 2021-10-22 17:02:42 +05:30
parent 36380fe5fd
commit f70270a0b3
2 changed files with 4 additions and 4 deletions

View file

@ -87,10 +87,10 @@ function SearchedEmoji() {
function handleSearchEmoji(resultEmojis, term) {
if (term === '' || resultEmojis.length === 0) {
if (term === '') setSearchedEmojis(null);
else setSearchedEmojis([]);
else setSearchedEmojis({ emojis: [] });
return;
}
setSearchedEmojis(resultEmojis);
setSearchedEmojis({ emojis: resultEmojis });
}
useEffect(() => {
@ -102,7 +102,7 @@ function SearchedEmoji() {
if (searchedEmojis === null) return false;
return <EmojiGroup key="-1" name={searchedEmojis.length === 0 ? 'No search result found' : 'Search results'} groupEmojis={searchedEmojis} />;
return <EmojiGroup key="-1" name={searchedEmojis.emojis.length === 0 ? 'No search result found' : 'Search results'} groupEmojis={searchedEmojis.emojis} />;
}
function EmojiBoard({ onSelect }) {

View file

@ -149,7 +149,7 @@ function PeopleDrawer({ roomId }) {
}
<div className="people-drawer__load-more">
{
mList.length !== 0 && mList.length > itemCount && (
mList.length !== 0 && memberList.length > itemCount && (
<Button onClick={loadMorePeople}>View more</Button>
)
}