Fixed auto role tables #1.1.0.rc5

This commit is contained in:
2023-08-18 08:05:27 +02:00
parent 7bfa39f459
commit 78b761a672
91 changed files with 168 additions and 170 deletions

View File

@@ -81,7 +81,7 @@ export class AutoRolesRulesComponent extends ComponentWithTable implements OnIni
private route: ActivatedRoute,
private router: Router
) {
super('auto-role-rules', ['id', 'role', 'emoji']);
super("auto-role-rules", ["id", "role", "emoji"]);
}
public getEmojiUrl(name: string): string {
@@ -102,10 +102,8 @@ export class AutoRolesRulesComponent extends ComponentWithTable implements OnIni
this.spinner.showSpinner();
this.data.query<SingleDiscordQuery>(Queries.guildsQuery, {
filter: {
id: server.discordId
}
},
id: server?.discordId
}
).subscribe(data => {
if (data.discord.guilds) {
this.guild = data.discord.guilds[0];
@@ -285,7 +283,7 @@ export class AutoRolesRulesComponent extends ComponentWithTable implements OnIni
public addAutoRoleRule(table: Table): void {
const newAutoRole = JSON.parse(JSON.stringify(this.newAutoRoleTemplate));
newAutoRole.id = Math.max.apply(Math, this.rules.map(u => {
newAutoRole.id = this.rules.length == 0 ? 1 : Math.max.apply(Math, this.rules.map(u => {
return u.id ?? 0;
})) + 1;

View File

@@ -2,6 +2,6 @@
"WebVersion": {
"Major": "1",
"Minor": "1",
"Micro": "0.rc4"
"Micro": "0.rc5"
}
}