[core] NOWEB - fix channel list

fix #1177
This commit is contained in:
devlikepro committed 2025-08-05 15:53:41 +07:00
1 parent d8ffd3e543
commit fc25df8104
1 file changed
+4 -1
+4 -1
View File
@@ -1768,7 +1768,10 @@ export class WhatsappSessionNoWebCore extends WhatsappSession {
public async channelsList(query: ListChannelsQuery): Promise<Channel[]> {
const newsletters = await this.sock.newsletterSubscribed();
let channels = newsletters.map(toNewsletterMetadata).map(this.toChannel);
let channels = newsletters
.map(toNewsletterMetadata)
.filter(Boolean)
.map(this.toChannel);
if (query.role) {
// @ts-ignore
channels = channels.filter((channel) => channel.role === query.role);