Просмотр исходного кода

fix: logic to remove playlists now fully executes

Signed-off-by: Jonathan <theflametrooper@gmail.com>
Jonathan 4 лет назад
Родитель
Сommit
fde665f8ae

+ 5 - 2
backend/logic/actions/playlists.js

@@ -1079,12 +1079,14 @@ let lib = {
                 (next) => {
                     playlists
                         .runJob("DELETE_PLAYLIST", { playlistId })
-                        .then((playlist) => next(null, playlist))
+                        .then(next)
                         .catch(next);
                 },
 
                 (next) => {
-                    stationModel.find({ privatePlaylist: playlistId }, next);
+                    stationModel.find({ privatePlaylist: playlistId }, (err, res) => {
+                        next(err, res);
+                    });
                 },
 
                 (stations, next) => {
@@ -1123,6 +1125,7 @@ let lib = {
                                         } else next();
                                     },
                                 ],
+
                                 (err) => {
                                     next();
                                 }

+ 1 - 1
frontend/components/Modals/EditStation.vue

@@ -156,7 +156,7 @@
 				</div>
 
 				<!--  Choose a playlist -->
-				<div v-if="!editing.partyMode">
+				<div v-if="!editing.partyMode && playlists.length > 0">
 					<hr style="margin: 10px 0 20px 0;" />
 
 					<h4 class="modal-section-title">Choose a playlist</h4>

+ 1 - 0
frontend/components/Modals/Playlists/Edit.vue

@@ -362,6 +362,7 @@ export default {
 		},
 		removePlaylist() {
 			this.socket.emit("playlists.remove", this.playlist._id, res => {
+				console.log(123, res);
 				new Toast({ content: res.message, timeout: 3000 });
 				if (res.status === "success") {
 					this.closeModal({

+ 1 - 0
frontend/main.js

@@ -13,6 +13,7 @@ const handleMetadata = attrs => {
 Vue.component("metadata", {
 	watch: {
 		$attrs: {
+			// eslint-disable-next-line vue/no-arrow-functions-in-watch
 			handler: attrs => {
 				handleMetadata(attrs);
 			},