Fix checking unknown components

Hopefully fixes the lag switching channels when Discord has been open for a while.

https://discordapp.com/channels/400734824740028417/423193907736870920/573535069764059157
This commit is contained in:
Samuel Elliott 2019-05-02 18:02:29 +01:00
parent f2c461d16e
commit 9c4653ffd4
No known key found for this signature in database
GPG Key ID: 8420C7CDE43DC4D6
1 changed files with 2 additions and 4 deletions

View File

@ -322,7 +322,6 @@ export class ReactComponents {
}
static processUnknown(component, retVal) {
const have = this.unknownComponents.find(c => c.component === component);
for (const [fi, filter] of this.nameSetters.entries()) {
if (filter.filter.filter(component)) {
Logger.log('ReactComponents', 'Filter match!');
@ -331,9 +330,8 @@ export class ReactComponents {
return this.push(component, retVal);
}
}
if (have) return have;
this.unknownComponents.push(component);
return component;
if (!this.unknownComponents.includes(component)) this.unknownComponents.push(component);
}
}