fix(chat): fix bot status not showing. Closes #3046

This commit is contained in:
Gabe Kangas
2023-05-31 13:54:03 -07:00
parent 1ed51859b0
commit 71703f2245
5 changed files with 19 additions and 15 deletions
+7 -6
View File
@@ -9,6 +9,11 @@ export class User {
this.nameChangedAt = u.nameChangedAt;
this.scopes = u.scopes;
this.authenticated = u.authenticated;
this.isBot = u.isBot;
if (this.scopes && this.scopes.length > 0) {
this.isModerator = this.scopes.includes('MODERATOR');
}
}
id: string;
@@ -27,11 +32,7 @@ export class User {
authenticated: boolean;
public isModerator = (): boolean => {
if (!this.scopes || this.scopes.length === 0) {
return false;
}
isBot: boolean;
return this.scopes.includes('MODERATOR');
};
isModerator: boolean;
}