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 {
7171 }
7272
7373 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 )
7575 }
7676
7777 subscribe ( ws : WebSocket , name : SubscriptionName , reqid : number ) : void {
7878 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 )
8081 if ( curUnsubscribed ) {
8182 this . sendMessage (
8283 ws ,
@@ -108,7 +109,7 @@ export class RootChannel extends WebSocketTopicBase implements WebSocketTopic {
108109
109110 unsubscribe ( ws : WebSocket , name : SubscriptionName , reqid : number ) : void {
110111 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 )
112113 if ( curSubscribed ) {
113114 topic . removeSubscriber ( ws )
114115 this . sendMessage (
You can’t perform that action at this time.
0 commit comments