feat(frontend): Misskey Gamesのリストに鯖缶指定のチャンネルを載せる (MisskeyIO#383)

This commit is contained in:
まっちゃとーにゅ 2024-01-24 19:57:51 +09:00 committed by GitHub
parent 7884901950
commit ac79f1fdc1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
24 changed files with 232 additions and 13 deletions

View file

@ -97,5 +97,14 @@ export class ChannelEntityService {
} : {}),
};
}
}
public async packMany(
channels: (MiChannel['id'] | MiChannel)[],
me: { id: MiUser['id'] } | null | undefined,
detailed?: boolean,
): Promise<Packed<'Channel'>[]> {
return (await Promise.allSettled(channels.map(x => this.pack(x, me, detailed))))
.filter(result => result.status === 'fulfilled')
.map(result => (result as PromiseFulfilledResult<Packed<'Channel'>>).value);
}
}