fix secondary channels

This commit is contained in:
marlon-erler
2024-07-09 18:44:13 +02:00
parent a1a9fd073c
commit c15ead428e
2 changed files with 9 additions and 8 deletions
+5 -4
View File
@@ -98,12 +98,13 @@ export class Chat {
chats.remove(this);
chatIds.remove(this.id);
}
};
// handlers
onmessage = async (data: Message): Promise<void> => {
if (data.messageChannel && data.messageChannel != this.primaryChannel.value)
return;
if (!data.messageChannel) return;
const channels = data.messageChannel.split("/");
if (!this.primaryChannel.value in channels) return;
if (data.subscribed != undefined) this.handleSubscription(data.subscribed);
@@ -132,7 +133,7 @@ export class Chat {
// get channels
const secondaryChannelNames: string[] = [
...this.secondaryChannels.value.values(),
].map((channel) => channel);
];
const allChannelNames: string[] = [
this.primaryChannel.value,
...secondaryChannelNames,