cleanup
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user