App > Stop listening to socket events

This commit is contained in:
brunosimon
2019-06-05 23:36:59 +02:00
parent 2a9a4ca2e1
commit 6338fc8ac8
6 changed files with 95 additions and 37 deletions
+7 -3
View File
@@ -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)