Browse Source

fix: station editsong local paused didn't work anymore

Kristian Vos 3 years ago
parent
commit
d2f0356e0b
1 changed files with 23 additions and 12 deletions
  1. 23 12
      frontend/src/pages/Station/index.vue

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

@@ -903,18 +903,29 @@ export default {
 		})
 		})
 	},
 	},
 	async mounted() {
 	async mounted() {
-		// TODO fix
+		this.editSongModalWatcher = this.$store.watch(
-		// this.editSongModalWatcher = this.$store.watch(
+			state =>
-		// 	state => state.modals.editSong.video.paused,
+				state.modalVisibility.activeModals.length > 0 &&
-		// 	paused => {
+				state.modalVisibility.modals[
-		// 		if (paused && !this.beforeEditSongModalLocalPaused) {
+					state.modalVisibility.activeModals[
-		// 			this.resumeLocalStation();
+						state.modalVisibility.activeModals.length - 1
-		// 		} else if (!paused) {
+					]
-		// 			this.beforeEditSongModalLocalPaused = this.localPaused;
+				] === "editSong"
-		// 			this.pauseLocalStation();
+					? state.modals.editSong[
-		// 		}
+							state.modalVisibility.activeModals[
-		// 	}
+								state.modalVisibility.activeModals.length - 1
-		// );
+							]
+					  ].video.paused
+					: null,
+			paused => {
+				if (paused && !this.beforeEditSongModalLocalPaused) {
+					this.resumeLocalStation();
+				} else if (!paused) {
+					this.beforeEditSongModalLocalPaused = this.localPaused;
+					this.pauseLocalStation();
+				}
+			}
+		);
 
 
 		window.scrollTo(0, 0);
 		window.scrollTo(0, 0);