فهرست منبع

refactor: cleaned up unused mappings due to new modal system, temporarily commented out broken code

Kristian Vos 2 سال پیش
والد
کامیت
af078c3a07

+ 0 - 1
frontend/src/components/modals/EditSong/index.vue

@@ -778,7 +778,6 @@ export default {
 			newSong: state => state.newSong
 		}),
 		...mapState("modalVisibility", {
-			modals: state => state.modals,
 			activeModals: state => state.activeModals
 		}),
 		...mapGetters({

+ 1 - 4
frontend/src/components/modals/EditSongs.vue

@@ -170,7 +170,7 @@
 </template>
 
 <script>
-import { mapState, mapActions, mapGetters } from "vuex";
+import { mapActions, mapGetters } from "vuex";
 import { defineAsyncComponent } from "vue";
 
 import Toast from "toasters";
@@ -231,9 +231,6 @@ export default {
 			songIds: state => state.songIds,
 			songPrefillData: state => state.songPrefillData
 		}),
-		...mapState("modalVisibility", {
-			modals: state => state.modals
-		}),
 		...mapGetters({
 			socket: "websockets/getSocket"
 		})

+ 1 - 4
frontend/src/components/modals/ImportAlbum.vue

@@ -324,7 +324,7 @@
 </template>
 
 <script>
-import { mapState, mapGetters, mapActions } from "vuex";
+import { mapGetters, mapActions } from "vuex";
 
 import draggable from "vuedraggable";
 import Toast from "toasters";
@@ -389,9 +389,6 @@ export default {
 			editingSongs: state => state.editingSongs,
 			prefillDiscogs: state => state.prefillDiscogs
 		}),
-		...mapState("modalVisibility", {
-			modals: state => state.modals
-		}),
 		...mapGetters({
 			socket: "websockets/getSocket"
 		})

+ 1 - 4
frontend/src/components/modals/Report.vue

@@ -203,7 +203,7 @@
 </template>
 
 <script>
-import { mapState, mapGetters, mapActions } from "vuex";
+import { mapGetters, mapActions } from "vuex";
 import Toast from "toasters";
 import ws from "@/ws";
 import { mapModalState } from "@/vuex_helpers";
@@ -351,9 +351,6 @@ export default {
 		...mapModalState("modals/report/MODAL_UUID", {
 			song: state => state.song
 		}),
-		...mapState("modalVisibility", {
-			modals: state => state.modals
-		}),
 		...mapGetters({
 			socket: "websockets/getSocket"
 		})

+ 1 - 6
frontend/src/pages/Admin/Playlists.vue

@@ -87,7 +87,7 @@
 </template>
 
 <script>
-import { mapState, mapActions } from "vuex";
+import { mapActions } from "vuex";
 
 import AdvancedTable from "@/components/AdvancedTable.vue";
 import RunJobDropdown from "@/components/RunJobDropdown.vue";
@@ -315,11 +315,6 @@ export default {
 			]
 		};
 	},
-	computed: {
-		...mapState("modalVisibility", {
-			modals: state => state.modals
-		})
-	},
 	methods: {
 		getDateFormatted(createdAt) {
 			const date = new Date(createdAt);

+ 1 - 4
frontend/src/pages/Admin/Punishments.vue

@@ -124,7 +124,7 @@
 </template>
 
 <script>
-import { mapState, mapGetters, mapActions } from "vuex";
+import { mapGetters, mapActions } from "vuex";
 import Toast from "toasters";
 
 import AdvancedTable from "@/components/AdvancedTable.vue";
@@ -271,9 +271,6 @@ export default {
 		};
 	},
 	computed: {
-		...mapState("modalVisibility", {
-			modals: state => state.modals
-		}),
 		...mapGetters({
 			socket: "websockets/getSocket"
 		})

+ 1 - 6
frontend/src/pages/Admin/Reports.vue

@@ -110,7 +110,7 @@
 </template>
 
 <script>
-import { mapState, mapActions } from "vuex";
+import { mapActions } from "vuex";
 
 import Toast from "toasters";
 
@@ -258,11 +258,6 @@ export default {
 			}
 		};
 	},
-	computed: {
-		...mapState("modalVisibility", {
-			modals: state => state.modals
-		})
-	},
 	methods: {
 		resolve(reportId, value) {
 			return this.resolveReport({ reportId, value })

+ 0 - 3
frontend/src/pages/Admin/Songs.vue

@@ -595,9 +595,6 @@ export default {
 		};
 	},
 	computed: {
-		...mapState("modalVisibility", {
-			modals: state => state.modals
-		}),
 		...mapState("modals/editSong", {
 			song: state => state.song
 		}),

+ 1 - 4
frontend/src/pages/Admin/Stations.vue

@@ -148,7 +148,7 @@
 </template>
 
 <script>
-import { mapState, mapActions, mapGetters } from "vuex";
+import { mapActions, mapGetters } from "vuex";
 
 import Toast from "toasters";
 
@@ -448,9 +448,6 @@ export default {
 		};
 	},
 	computed: {
-		...mapState("modalVisibility", {
-			modals: state => state.modals
-		}),
 		...mapGetters({
 			socket: "websockets/getSocket"
 		})

+ 1 - 6
frontend/src/pages/Admin/Users/index.vue

@@ -97,7 +97,7 @@
 </template>
 
 <script>
-import { mapState, mapActions } from "vuex";
+import { mapActions } from "vuex";
 
 import AdvancedTable from "@/components/AdvancedTable.vue";
 import ProfilePicture from "@/components/ProfilePicture.vue";
@@ -294,11 +294,6 @@ export default {
 			}
 		};
 	},
-	computed: {
-		...mapState("modalVisibility", {
-			modals: state => state.modals
-		})
-	},
 	mounted() {
 		if (this.$route.query.userId) this.edit(this.$route.query.userId);
 	},

+ 1 - 6
frontend/src/pages/Profile/Tabs/Playlists.vue

@@ -92,7 +92,7 @@
 </template>
 
 <script>
-import { mapActions, mapState, mapGetters } from "vuex";
+import { mapActions, mapGetters } from "vuex";
 
 import PlaylistItem from "@/components/PlaylistItem.vue";
 import SortablePlaylists from "@/mixins/SortablePlaylists.vue";
@@ -114,11 +114,6 @@ export default {
 		}
 	},
 	computed: {
-		...mapState({
-			...mapState("modalVisibility", {
-				modals: state => state.modals
-			})
-		}),
 		...mapGetters({
 			socket: "websockets/getSocket"
 		})

+ 0 - 3
frontend/src/pages/Profile/Tabs/RecentActivity.vue

@@ -66,9 +66,6 @@ export default {
 	},
 	computed: {
 		...mapState({
-			...mapState("modalVisibility", {
-				modals: state => state.modals
-			}),
 			myUserId: state => state.user.auth.userId
 		}),
 		...mapGetters({

+ 1 - 4
frontend/src/pages/Profile/index.vue

@@ -130,10 +130,7 @@ export default {
 	computed: {
 		...mapState({
 			role: state => state.user.auth.role,
-			myUserId: state => state.user.auth.userId,
-			...mapState("modalVisibility", {
-				modals: state => state.modals
-			})
+			myUserId: state => state.user.auth.userId
 		}),
 		...mapGetters({
 			socket: "websockets/getSocket"

+ 1 - 4
frontend/src/pages/Settings/index.vue

@@ -46,7 +46,7 @@
 </template>
 
 <script>
-import { mapActions, mapGetters, mapState } from "vuex";
+import { mapActions, mapGetters } from "vuex";
 import { defineAsyncComponent } from "vue";
 import Toast from "toasters";
 import ws from "@/ws";
@@ -77,9 +77,6 @@ export default {
 	computed: {
 		...mapGetters({
 			socket: "websockets/getSocket"
-		}),
-		...mapState("modalVisibility", {
-			modals: state => state.modals
 		})
 	},
 	mounted() {

+ 12 - 11
frontend/src/pages/Station/index.vue

@@ -903,17 +903,18 @@ export default {
 		})
 	},
 	async mounted() {
-		this.editSongModalWatcher = this.$store.watch(
-			state => state.modals.editSong.video.paused,
-			paused => {
-				if (paused && !this.beforeEditSongModalLocalPaused) {
-					this.resumeLocalStation();
-				} else if (!paused) {
-					this.beforeEditSongModalLocalPaused = this.localPaused;
-					this.pauseLocalStation();
-				}
-			}
-		);
+		// TODO fix
+		// this.editSongModalWatcher = this.$store.watch(
+		// 	state => state.modals.editSong.video.paused,
+		// 	paused => {
+		// 		if (paused && !this.beforeEditSongModalLocalPaused) {
+		// 			this.resumeLocalStation();
+		// 		} else if (!paused) {
+		// 			this.beforeEditSongModalLocalPaused = this.localPaused;
+		// 			this.pauseLocalStation();
+		// 		}
+		// 	}
+		// );
 
 		window.scrollTo(0, 0);