mirror of
https://github.com/cinnyapp/cinny.git
synced 2025-11-14 19:20:28 +03:00
* remove limit from emoji autocomplete * remove search limit from user mention * remove limit from room mention autocomplete * increase user search limit to 1000 * better search string selection for emoticons
19 lines
564 B
TypeScript
19 lines
564 B
TypeScript
import { SearchItemStrGetter } from '../hooks/useAsyncSearch';
|
|
import { PackImageReader } from './custom-emoji';
|
|
import { IEmoji } from './emoji';
|
|
|
|
export const getEmoticonSearchStr: SearchItemStrGetter<PackImageReader | IEmoji> = (item) => {
|
|
const shortcode = `:${item.shortcode}:`;
|
|
if (item instanceof PackImageReader) {
|
|
if (item.body) {
|
|
return [shortcode, item.body];
|
|
}
|
|
return shortcode;
|
|
}
|
|
|
|
const names = [shortcode, item.label];
|
|
if (Array.isArray(item.shortcodes)) {
|
|
return names.concat(item.shortcodes);
|
|
}
|
|
return names;
|
|
};
|