File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
packages/live-status-gateway/src/topics Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -71,12 +71,13 @@ export class RootChannel extends WebSocketTopicBase implements WebSocketTopic {
71
71
}
72
72
73
73
addTopic ( channel : string , topic : WebSocketTopic ) : void {
74
- if ( channel in SubscriptionName ) this . _topics . set ( channel , topic )
74
+ if ( Object . values < string > ( SubscriptionName ) . includes ( channel ) ) this . _topics . set ( channel , topic )
75
75
}
76
76
77
77
subscribe ( ws : WebSocket , name : SubscriptionName , reqid : number ) : void {
78
78
const topic = this . _topics . get ( name )
79
- const curUnsubscribed = topic && ! topic . hasSubscriber ( ws ) && name in SubscriptionName
79
+ const curUnsubscribed =
80
+ topic && ! topic . hasSubscriber ( ws ) && Object . values < string > ( SubscriptionName ) . includes ( name )
80
81
if ( curUnsubscribed ) {
81
82
this . sendMessage (
82
83
ws ,
@@ -108,7 +109,7 @@ export class RootChannel extends WebSocketTopicBase implements WebSocketTopic {
108
109
109
110
unsubscribe ( ws : WebSocket , name : SubscriptionName , reqid : number ) : void {
110
111
const topic = this . _topics . get ( name )
111
- const curSubscribed = topic && topic . hasSubscriber ( ws ) && name in SubscriptionName
112
+ const curSubscribed = topic && topic . hasSubscriber ( ws ) && Object . values < string > ( SubscriptionName ) . includes ( name )
112
113
if ( curSubscribed ) {
113
114
topic . removeSubscriber ( ws )
114
115
this . sendMessage (
You can’t perform that action at this time.
0 commit comments