Improve search result counts (#2221)
* 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
This commit is contained in:
19
src/app/plugins/utils.ts
Normal file
19
src/app/plugins/utils.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
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;
|
||||
};
|
||||
Reference in New Issue
Block a user