Simplified some code
This commit is contained in:
parent
f7e1708039
commit
157493b0f4
@ -45,17 +45,18 @@ class ChatInputComponent extends HTMLElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
resolveAutoComplete() {
|
resolveAutoComplete() {
|
||||||
let count = 0;
|
|
||||||
let value = null;
|
let value = null;
|
||||||
|
|
||||||
Object.keys(this.allAutoCompletions).forEach((key) => {
|
for (const key of Object.keys(this.allAutoCompletions)) {
|
||||||
if (key.startsWith(this.value.split(" ")[0])) {
|
if (key.startsWith(this.value.split(" ", 1)[0])) {
|
||||||
count++;
|
if (value) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
value = key;
|
value = key;
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
if (count == 1) return value;
|
|
||||||
return null;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
isActive() {
|
isActive() {
|
||||||
|
Loading…
Reference in New Issue
Block a user