Переглянути джерело

fix: Leftover old volume calculations

Owen Diffey 3 роки тому
батько
коміт
13cc6493a3

+ 4 - 4
frontend/src/components/modals/EditSong/index.vue

@@ -768,7 +768,7 @@ export default {
 		volume =
 			typeof volume === "number" && !Number.isNaN(volume) ? volume : 20;
 		localStorage.setItem("volume", volume);
-		this.volumeSliderValue = volume * 100;
+		this.volumeSliderValue = volume;
 
 		if (!this.newSong) {
 			this.socket.on(
@@ -841,7 +841,7 @@ export default {
 			preventDefault: true,
 			handler: () => {
 				this.volumeSliderValue = Math.min(
-					10000,
+					100,
 					this.volumeSliderValue + 10
 				);
 				this.changeVolume();
@@ -854,7 +854,7 @@ export default {
 			preventDefault: true,
 			handler: () => {
 				this.volumeSliderValue = Math.min(
-					10000,
+					100,
 					this.volumeSliderValue + 1
 				);
 				this.changeVolume();
@@ -1672,7 +1672,7 @@ export default {
 						: null,
 					youtubeId: this.song.youtubeId,
 					muted: this.muted,
-					volume: this.volumeSliderValue / 100,
+					volume: this.volumeSliderValue,
 					startedDuration:
 						this.activityWatchVideoLastStartDuration <= 0
 							? 0

+ 3 - 3
frontend/src/pages/Station/index.vue

@@ -1220,7 +1220,7 @@ export default {
 		if (JSON.parse(localStorage.getItem("muted"))) {
 			this.muted = true;
 			this.player.setVolume(0);
-			this.volumeSliderValue = 0 * 100;
+			this.volumeSliderValue = 0;
 		} else {
 			let volume = parseFloat(localStorage.getItem("volume"));
 			volume =
@@ -1228,7 +1228,7 @@ export default {
 					? volume
 					: 20;
 			localStorage.setItem("volume", volume);
-			this.volumeSliderValue = volume * 100;
+			this.volumeSliderValue = volume;
 		}
 	},
 	beforeUnmount() {
@@ -2276,7 +2276,7 @@ export default {
 							: null,
 					youtubeId: this.currentSong.youtubeId,
 					muted: this.muted,
-					volume: this.volumeSliderValue / 100,
+					volume: this.volumeSliderValue,
 					startedDuration:
 						this.activityWatchVideoLastStartDuration <= 0
 							? 0