forked from rDrama/rDrama
simplify globalUsers and globalGroups
parent
ffaeaea70b
commit
6ed0c57951
|
@ -169,7 +169,7 @@ function update_inline_emoji_modal(event)
|
|||
// Do the search (and do something with it)
|
||||
const resultSet = groupsSearchDictionary.completeSearch(current_word.substring(1));
|
||||
|
||||
const found = globalGroups.filter(i => resultSet.has(i.name));
|
||||
const found = globalGroups.filter(i => resultSet.has(i));
|
||||
|
||||
populate_inline_group_modal(found, event.target);
|
||||
});
|
||||
|
@ -188,7 +188,7 @@ function update_inline_emoji_modal(event)
|
|||
// Do the search (and do something with it)
|
||||
const resultSet = usersSearchDictionary.completeSearch(current_word.substring(1));
|
||||
|
||||
const found = globalUsers.filter(i => resultSet.has(i.name));
|
||||
const found = globalUsers.filter(i => resultSet.has(i));
|
||||
|
||||
populate_inline_user_modal(found, event.target);
|
||||
});
|
||||
|
|
|
@ -58,9 +58,7 @@ function makeGroupsSearchDictionary() {
|
|||
{
|
||||
const group = groups[i];
|
||||
groupsSearchDictionary.updateTag(group, group);
|
||||
globalGroups.push({
|
||||
name: group,
|
||||
});
|
||||
globalGroups.push(group);
|
||||
}
|
||||
|
||||
groupSearchDictionaryState = "ready";
|
||||
|
@ -105,10 +103,8 @@ function populate_inline_group_modal(results, textbox)
|
|||
const MAXXX = 50;
|
||||
// Not sure why the results is a Set... but oh well
|
||||
let i = 0;
|
||||
for (let group of results)
|
||||
for (let name of results)
|
||||
{
|
||||
let name = group.name
|
||||
|
||||
if (i++ > MAXXX) return i;
|
||||
let group_option = document.createElement("div");
|
||||
group_option.className = "inline-modal-option group-option " + (i === 1 ? "selected" : "");
|
||||
|
|
|
@ -58,9 +58,7 @@ function makeUsersSearchDictionary() {
|
|||
{
|
||||
const user = users[i];
|
||||
usersSearchDictionary.updateTag(user, user);
|
||||
globalUsers.push({
|
||||
name: user,
|
||||
});
|
||||
globalUsers.push(user);
|
||||
}
|
||||
|
||||
userSearchDictionaryState = "ready";
|
||||
|
@ -105,10 +103,8 @@ function populate_inline_user_modal(results, textbox)
|
|||
const MAXXX = 50;
|
||||
// Not sure why the results is a Set... but oh well
|
||||
let i = 0;
|
||||
for (let user of results)
|
||||
for (let name of results)
|
||||
{
|
||||
let name = user.name
|
||||
|
||||
if (i++ > MAXXX) return i;
|
||||
let user_option = document.createElement("div");
|
||||
user_option.className = "inline-modal-option user-option " + (i === 1 ? "selected" : "");
|
||||
|
|
Loading…
Reference in New Issue