소스 검색

Now clearing the queue when toggling party mode

Kristian Vos 4 년 전
부모
커밋
1dd4366a56
1개의 변경된 파일7개의 추가작업 그리고 1개의 파일을 삭제
  1. 7 1
      backend/logic/actions/stations.js

+ 7 - 1
backend/logic/actions/stations.js

@@ -1978,13 +1978,19 @@ export default {
 						return next(`The party mode was already ${newPartyMode ? "enabled." : "disabled."}`);
 					return stationModel.updateOne(
 						{ _id: stationId },
-						{ $set: { partyMode: newPartyMode } },
+						{ $set: { partyMode: newPartyMode, queue: [] } },
 						{ runValidators: true },
 						next
 					);
 				},
 
 				(res, next) => {
+					CacheModule.runJob("PUB", {
+						channel: "station.queueUpdate",
+						value: stationId
+					})
+						.then()
+						.catch();
 					StationsModule.runJob("UPDATE_STATION", { stationId }, this)
 						.then(station => {
 							next(null, station);