1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-08-01 15:38:31 +00:00
* Fixed: Sort emotes in the tab-completion list using similar logic to vanilla Twitch.
* Changed: When the tab-completion list is limited to 25 entries, stop looking up further entries if we already have 25 or more.
This commit is contained in:
SirStendec 2019-06-30 15:05:05 -04:00
parent 92f5b7f2c9
commit c8c2afac20
2 changed files with 8 additions and 4 deletions

View file

@ -212,17 +212,21 @@ export default class Input extends Module {
inst.getMatchedEmotes = function(input) {
const limitResults = t.chat.context.get('chat.tab-complete.limit-results');
let results = t.getTwitchEmoteSuggestions(input, this);
if ( limitResults && results.length >= 25 )
return results.slice(0, 25);
if ( t.chat.context.get('chat.tab-complete.ffz-emotes') ) {
const ffz_emotes = t.getEmoteSuggestions(input, this);
if ( Array.isArray(ffz_emotes) && ffz_emotes.length )
results = Array.isArray(results) ? results.concat(ffz_emotes) : ffz_emotes;
results = results.concat(ffz_emotes);
}
if ( limitResults && results.length >= 25 )
return results.slice(0, 25);
if ( ! t.chat.context.get('chat.tab-complete.emoji') )
return limitResults && results.length > 25 ? results.slice(0, 25) : results;
return results;
const emoji = t.getEmojiSuggestions(input, this);
if ( Array.isArray(emoji) && emoji.length )