Browse Source

fix(WS): leaving a station doesn't leave the song room

Signed-off-by: Jonathan <theflametrooper@gmail.com>
Jonathan 3 years ago
parent
commit
0858e3caba
1 changed files with 2 additions and 3 deletions
  1. 2 3
      backend/logic/actions/stations.js

+ 2 - 3
backend/logic/actions/stations.js

@@ -1455,9 +1455,7 @@ export default {
 			[
 				next => {
 					StationsModule.runJob("GET_STATION", { stationId }, this)
-						.then(station => {
-							next(null, station);
-						})
+						.then(station => next(null, station))
 						.catch(next);
 				},
 
@@ -1476,6 +1474,7 @@ export default {
 				this.log("SUCCESS", "STATIONS_LEAVE", `Left station "${stationId}" successfully.`);
 
 				WSModule.runJob("SOCKET_LEAVE_ROOM", { socketId: session.socketId, room: `station.${stationId}` });
+				WSModule.runJob("SOCKETS_LEAVE_SONG_ROOMS", { sockets: [session.socketId] });
 
 				delete StationsModule.userList[session.socketId];