mirror of
https://github.com/cinnyapp/cinny.git
synced 2025-11-15 03:30:29 +03:00
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:
parent
3ada21a1df
commit
1b200eb676
6 changed files with 53 additions and 40 deletions
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;
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue