Browse Source

fix(Tooltips): hiding tippy elements on song actions works again

Signed-off-by: Jonathan <theflametrooper@gmail.com>
Jonathan 3 years ago
parent
commit
2a66b8bfa3

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

@@ -532,20 +532,20 @@ CacheModule.runJob("SUB", {
 	cb: async stationId => {
 		const userModel = await DBModule.runJob("GET_MODEL", { modelName: "user" });
 
-		StationsModule.runJob("INITIALIZE_STATION", { stationId }).then(async response => {
-			const { station } = response;
+		StationsModule.runJob("INITIALIZE_STATION", { stationId }).then(async res => {
+			const { station } = res;
 			station.userCount = StationsModule.usersPerStationCount[stationId] || 0;
 
 			WSModule.runJob("EMIT_TO_ROOM", {
 				room: "admin.stations",
 				args: ["event:admin.station.created", { data: { station } }]
-			}).then(() => {});
+			});
 
 			if (station.privacy === "public")
 				WSModule.runJob("EMIT_TO_ROOM", {
 					room: "home",
 					args: ["event:station.created", { data: { station } }]
-				}).then(() => {});
+				});
 			else {
 				const sockets = await WSModule.runJob("GET_SOCKETS_FOR_ROOM", {
 					room: "home"
@@ -2653,12 +2653,7 @@ export default {
 				next => {
 					stationModel.findOne(
 						{
-							$or: [
-								{ name: data.name },
-								{
-									displayName: new RegExp(`^${data.displayName}$`, "i")
-								}
-							]
+							$or: [{ name: data.name }, { displayName: new RegExp(`^${data.displayName}$`, "i") }]
 						},
 						next
 					);
@@ -2851,7 +2846,6 @@ export default {
 					if (station.type !== "official") return next(null, station);
 
 					const stationId = station._id;
-					console.log(111, station, genrePlaylistIds, blacklistedGenrePlaylistIds, next);
 
 					return async.waterfall(
 						[
@@ -2861,9 +2855,7 @@ export default {
 									1,
 									(playlistId, next) => {
 										StationsModule.runJob("INCLUDE_PLAYLIST", { stationId, playlistId }, this)
-											.then(() => {
-												next();
-											})
+											.then(() => next())
 											.catch(next);
 									},
 									next
@@ -2876,9 +2868,7 @@ export default {
 									1,
 									(playlistId, next) => {
 										StationsModule.runJob("EXCLUDE_PLAYLIST", { stationId, playlistId }, this)
-											.then(() => {
-												next();
-											})
+											.then(() => next())
 											.catch(next);
 									},
 									next

+ 1 - 1
frontend/src/components/SongItem.vue

@@ -217,7 +217,7 @@ export default {
 			return null;
 		},
 		hideTippyElements() {
-			this.$refs.songActions.tip.hide();
+			this.$refs.songActions.tippy.hide();
 
 			setTimeout(
 				() =>

+ 3 - 4
frontend/src/pages/Admin/tabs/Stations.vue

@@ -20,7 +20,7 @@
 					</tr>
 				</thead>
 				<tbody>
-					<tr v-for="station in stations" :key="station._id">
+					<tr v-for="(station, index) in stations" :key="station._id">
 						<td>
 							<span>{{ station._id }}</span>
 						</td>
@@ -310,9 +310,7 @@ export default {
 			this.socket.dispatch(
 				"stations.remove",
 				this.stations[index]._id,
-				res => {
-					new Toast(res.message);
-				}
+				res => new Toast(res.message)
 			);
 		},
 		manage(station) {
@@ -361,6 +359,7 @@ export default {
 				if (res.status === "success")
 					this.loadStations(res.data.stations);
 			});
+
 			this.socket.dispatch("apis.joinAdminRoom", "stations", () => {});
 		},
 		...mapActions("modalVisibility", ["openModal"]),