fix(server): lint errors
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import WebSocket from 'ws'
|
||||
import { Server as WsServer } from 'ws'
|
||||
|
||||
import { consoleError, consoleInfo } from '../helpers/errors'
|
||||
import wsModules from './modules'
|
||||
|
||||
@@ -8,7 +8,7 @@ import wsModules from './modules'
|
||||
|
||||
export const registerWebsocket = (wss: WsServer) => {
|
||||
wss.on('connection', ws => {
|
||||
ws.on('message', (message)=>{
|
||||
ws.on('message', message => {
|
||||
consoleInfo(`received: ${message}`)
|
||||
const data = JSON.parse(message.toString())
|
||||
wsModules.forEach(module => {
|
||||
|
||||
@@ -4,11 +4,11 @@ import { saveSettings, listener } from '../../main'
|
||||
|
||||
const eventName = 'saveSettings'
|
||||
|
||||
const cb = (data: any, ws: any, wss: WsServer) => {
|
||||
const {settings, spotifySettings} = data
|
||||
saveSettings(settings)
|
||||
consoleInfo('Settings saved')
|
||||
listener.send('updateSettings', {settings, spotifySettings})
|
||||
const cb = (data: any, _: any, __: WsServer) => {
|
||||
const { settings, spotifySettings } = data
|
||||
saveSettings(settings)
|
||||
consoleInfo('Settings saved')
|
||||
listener.send('updateSettings', { settings, spotifySettings })
|
||||
}
|
||||
|
||||
export default { eventName, cb }
|
||||
|
||||
Reference in New Issue
Block a user