This commit is contained in:
おさむのひと 2024-10-11 06:30:10 +09:00
parent 9339a41794
commit 346074c14f
1 changed files with 4 additions and 4 deletions

View File

@ -451,9 +451,9 @@ export class RoleService implements OnApplicationShutdown, OnModuleInit {
? await this.roleAssignmentsRepository.findBy({ roleId: In(moderatorRoles.map(r => r.id)) }) ? await this.roleAssignmentsRepository.findBy({ roleId: In(moderatorRoles.map(r => r.id)) })
: []; : [];
const now = Date.now();
// Setを経由して重複を除去ユーザIDは重複する可能性があるので // Setを経由して重複を除去ユーザIDは重複する可能性があるので
const result = new Set( const now = Date.now();
const resultSet = new Set(
assigns assigns
.filter(it => .filter(it =>
(excludeExpire) (excludeExpire)
@ -471,10 +471,10 @@ export class RoleService implements OnApplicationShutdown, OnModuleInit {
.getOneOrFail(); .getOneOrFail();
return it.id; return it.id;
}); });
result.add(rootUserId); resultSet.add(rootUserId);
} }
return [...result].sort((x, y) => x.localeCompare(y)); return [...resultSet].sort((x, y) => x.localeCompare(y));
} }
@bindThis @bindThis