Browse Source

Merge pull request #43 from Musare/experimental

Small annoying bug fixes
Vos 5 years ago
parent
commit
fd55db2a9c

+ 8 - 7
frontend/components/Admin/QueueSongs.vue

@@ -97,6 +97,7 @@
 
 <script>
 import { mapState, mapActions } from "vuex";
+import Vue from "vue";
 
 import Toast from "toasters";
 
@@ -130,12 +131,12 @@ export default {
 			modals: state => state.modals.admin
 		})
 	},
-	// watch: {
-	//   "modals.editSong": function(value) {
-	//     console.log(value);
-	//     if (value === false) this.stopVideo();
-	//   }
-	// },
+	watch: {
+		// eslint-disable-next-line func-names
+		"modals.editSong": function(value) {
+			if (value === false) this.stopVideo();
+		}
+	},
 	methods: {
 		edit(song, index) {
 			const newSong = {};
@@ -215,7 +216,7 @@ export default {
 				for (let i = 0; i < this.songs.length; i += 1) {
 					const song = this.songs[i];
 					if (song._id === updatedSong._id) {
-						this.songs.$set(i, updatedSong);
+						Vue.set(this.songs, i, updatedSong);
 					}
 				}
 			});

+ 2 - 1
frontend/components/Admin/Songs.vue

@@ -141,7 +141,8 @@ export default {
 		})
 	},
 	watch: {
-		"modals.editSong": val => {
+		// eslint-disable-next-line func-names
+		"modals.editSong": function(val) {
 			if (!val) this.stopVideo();
 		}
 	},

+ 1 - 1
frontend/components/pages/Home.vue

@@ -112,7 +112,7 @@
 							:title="'Now Playing: ' + station.currentSong.title"
 							>{{ station.currentSong.title }}</span
 						>
-						<span v-else class="songTitle">No Songs Playing</span>
+						<span v-else class="songTitle">No song</span>
 					</div>
 				</router-link>
 			</div>

+ 2 - 1
frontend/components/pages/News.vue

@@ -79,6 +79,7 @@
 
 <script>
 import { format } from "date-fns";
+import Vue from "vue";
 
 import MainHeader from "../MainHeader.vue";
 import MainFooter from "../MainFooter.vue";
@@ -106,7 +107,7 @@ export default {
 			this.socket.on("event:admin.news.updated", news => {
 				for (let n = 0; n < this.news.length; n += 1) {
 					if (this.news[n]._id === news._id) {
-						this.news.$set(n, news);
+						Vue.set(this.news, n, news);
 					}
 				}
 			});

+ 3 - 1
frontend/store/modules/admin.js

@@ -1,5 +1,7 @@
 /* eslint no-param-reassign: 0 */
 
+import Vue from "vue";
+
 const state = {};
 const getters = {};
 const actions = {};
@@ -84,7 +86,7 @@ const modules = {
 			updateSong(state, updatedSong) {
 				state.songs.forEach((song, index) => {
 					if (song._id === updatedSong._id)
-						state.songs.$set(index, updatedSong);
+						Vue.set(state.songs, index, updatedSong);
 				});
 			},
 			updateSongField(state, data) {