Fix wildcard matching in emojisearch (#121)
Signed-off-by: Ajay Bura <ajbura@gmail.com>
This commit is contained in:
parent
9b5f42cda9
commit
dc7ddeaa9b
2 changed files with 3 additions and 2 deletions
|
@ -80,7 +80,7 @@ EmojiGroup.propTypes = {
|
||||||
};
|
};
|
||||||
|
|
||||||
const asyncSearch = new AsyncSearch();
|
const asyncSearch = new AsyncSearch();
|
||||||
asyncSearch.setup(emojis, { keys: ['shortcode'], limit: 30 });
|
asyncSearch.setup(emojis, { keys: ['shortcode'], isContain: true, limit: 40 });
|
||||||
function SearchedEmoji() {
|
function SearchedEmoji() {
|
||||||
const [searchedEmojis, setSearchedEmojis] = useState(null);
|
const [searchedEmojis, setSearchedEmojis] = useState(null);
|
||||||
|
|
||||||
|
|
|
@ -319,6 +319,7 @@ function RoomViewCmdBar({ roomId, roomTimeline, viewEvent }) {
|
||||||
else if (searchTerm.match(/^[-]?(\()$/)) searchTerm = 'pleading_face';
|
else if (searchTerm.match(/^[-]?(\()$/)) searchTerm = 'pleading_face';
|
||||||
else if (searchTerm.match(/^[-]?(\$)$/)) searchTerm = 'money';
|
else if (searchTerm.match(/^[-]?(\$)$/)) searchTerm = 'money';
|
||||||
else if (searchTerm.match(/^(<3)$/)) searchTerm = 'heart';
|
else if (searchTerm.match(/^(<3)$/)) searchTerm = 'heart';
|
||||||
|
else if (searchTerm.match(/^(c|ca|cat)$/)) searchTerm = '_cat';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -343,7 +344,7 @@ function RoomViewCmdBar({ roomId, roomTimeline, viewEvent }) {
|
||||||
'>*': () => asyncSearch.setup(getRooms([...roomList.spaces]), { keys: ['name'], limit: 20 }),
|
'>*': () => asyncSearch.setup(getRooms([...roomList.spaces]), { keys: ['name'], limit: 20 }),
|
||||||
'>#': () => asyncSearch.setup(getRooms([...roomList.rooms]), { keys: ['name'], limit: 20 }),
|
'>#': () => asyncSearch.setup(getRooms([...roomList.rooms]), { keys: ['name'], limit: 20 }),
|
||||||
'>@': () => asyncSearch.setup(getRooms([...roomList.directs]), { keys: ['name'], limit: 20 }),
|
'>@': () => asyncSearch.setup(getRooms([...roomList.directs]), { keys: ['name'], limit: 20 }),
|
||||||
':': () => asyncSearch.setup(emojis, { keys: ['shortcode'], limit: 20 }),
|
':': () => asyncSearch.setup(emojis, { keys: ['shortcode'], isContain: true, limit: 20 }),
|
||||||
'@': () => asyncSearch.setup(matrixClient.getRoom(roomId).getJoinedMembers().map((member) => ({
|
'@': () => asyncSearch.setup(matrixClient.getRoom(roomId).getJoinedMembers().map((member) => ({
|
||||||
name: member.name,
|
name: member.name,
|
||||||
userId: member.userId.slice(1),
|
userId: member.userId.slice(1),
|
||||||
|
|
Loading…
Reference in a new issue