Skip to content

Commit

Permalink
Fix: Multiple we clients - returning -1 when using indexOf() cause al…
Browse files Browse the repository at this point in the history
…l clients reference to be deleted
  • Loading branch information
olzzon authored and olzzon committed Nov 13, 2020
1 parent ca94894 commit 006b7ec
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion server/utils/vuServer.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { socketServer } from '../expressHandler'

export enum VuType {
Channel = 'vuChannel',
Reduction = 'vuReduction',
Expand All @@ -11,7 +13,7 @@ export function socketSubscribeVu(socket: any) {

export function socketUnsubscribeVu(socket: any) {
const i = sockets.indexOf(socket)
if (i) {
if (i >= 0) {
sockets.splice(i, 1)
}
}
Expand Down

0 comments on commit 006b7ec

Please sign in to comment.