瀏覽代碼

fix(EditSongs): Missing modalUuid socket parameter

Owen Diffey 3 年之前
父節點
當前提交
b69c2a98a4
共有 1 個文件被更改,包括 26 次插入18 次删除
  1. 26 18
      frontend/src/components/modals/EditSongs.vue

+ 26 - 18
frontend/src/components/modals/EditSongs.vue

@@ -1,8 +1,8 @@
 <template>
 	<div>
 		<edit-song
-			:modal-module-path="`modals/editSongs/${this.modalUuid}/editSong`"
-			:modal-uuid="this.modalUuid"
+			:modal-module-path="`modals/editSongs/${modalUuid}/editSong`"
+			:modal-uuid="modalUuid"
 			:bulk="true"
 			:flagged="currentSongFlagged"
 			v-if="currentSong"
@@ -258,23 +258,31 @@ export default {
 			} else this.editNextSong();
 		});
 
-		this.socket.on(`event:admin.song.updated`, res => {
-			const index = this.items
-				.map(item => item.song._id)
-				.indexOf(res.data.song._id);
-			this.items[index].song = {
-				...this.items[index].song,
-				...res.data.song,
-				updated: true
-			};
-		});
+		this.socket.on(
+			`event:admin.song.updated`,
+			res => {
+				const index = this.items
+					.map(item => item.song._id)
+					.indexOf(res.data.song._id);
+				this.items[index].song = {
+					...this.items[index].song,
+					...res.data.song,
+					updated: true
+				};
+			},
+			{ modalUuid: this.modalUuid }
+		);
 
-		this.socket.on(`event:admin.song.removed`, res => {
-			const index = this.items
-				.map(item => item.song._id)
-				.indexOf(res.data.songId);
-			this.items[index].song.removed = true;
-		});
+		this.socket.on(
+			`event:admin.song.removed`,
+			res => {
+				const index = this.items
+					.map(item => item.song._id)
+					.indexOf(res.data.songId);
+				this.items[index].song.removed = true;
+			},
+			{ modalUuid: this.modalUuid }
+		);
 	},
 	beforeUnmount() {
 		this.socket.dispatch("apis.leaveRoom", "edit-songs");