This commit is contained in:
marlon-erler
2024-07-09 02:32:04 +02:00
parent 58475ff68b
commit b00c7927b5
+7 -2
View File
@@ -68,15 +68,20 @@ export class Mailbox implements Subscriber {
set ws(ws: WS) { set ws(ws: WS) {
this._ws = ws; this._ws = ws;
this.update();
}
update() {
if (!this._ws) return;
this.dateLastUsed = new Date(); this.dateLastUsed = new Date();
this.confirmConnection(); this.confirmConnection();
this.sendUnreadMessages(); this.sendUnreadMessages();
const channels = subscriptionMap.getChannelList(ws); const channels = subscriptionMap.getChannelList(this._ws);
channels?.forEach((channel) => this.subscribe(channel)); channels?.forEach((channel) => this.subscribe(channel));
subscriptionMap.deleteSubscriber(ws); subscriptionMap.deleteSubscriber(this._ws);
} }
// subscribing // subscribing