⚡ App > Stop listening to socket events
This commit is contained in:
+7
-3
@@ -16,8 +16,9 @@ class Projects
|
||||
// Save original socket and create a channel for projects
|
||||
this.projectsSocket = this.config.socket.of('/projects')
|
||||
|
||||
// Connection event
|
||||
this.projectsSocket.on('connection', (socket) =>
|
||||
// Callbacks
|
||||
this.socketCallbacks = {}
|
||||
this.socketCallbacks.connection = (socket) =>
|
||||
{
|
||||
// // Send the config to the new socket
|
||||
socket.emit('config', { domain: this.config.domain, server: this.config.server })
|
||||
@@ -29,7 +30,10 @@ class Projects
|
||||
{
|
||||
console.log(`${chalk.green.bold('projects > socket')} - ${chalk.cyan('connection')} - ${chalk.cyan(socket.id)}`)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// Connection event
|
||||
this.projectsSocket.on('connection', this.socketCallbacks.connection)
|
||||
}
|
||||
|
||||
createProject(_options)
|
||||
|
||||
Reference in New Issue
Block a user