Browse Source

When you first visit the site, the volume is automatically set to 50

theflametrooper 8 years ago
parent
commit
007d335c79
2 changed files with 3 additions and 1 deletions
  1. 1 1
      backend/logic/actions/stations.js
  2. 2 0
      frontend/components/Station/Station.vue

+ 1 - 1
backend/logic/actions/stations.js

@@ -399,7 +399,7 @@ module.exports = {
 
 	remove: hooks.ownerRequired((session, stationId, cb) => {
 		db.models.station.remove({ _id: stationId }, (err) => {
-			if (err) return cb({status: 'failure', message: 'Something went wrong when deleting that station.'});
+			if (err) return cb({ status: 'failure', message: 'Something went wrong when deleting that station' });
 			cache.hdel('stations', stationId, () => {
 				cache.pub('station.remove', stationId);
 				return cb({ status: 'success', message: 'Station successfully removed' });

+ 2 - 0
frontend/components/Station/Station.vue

@@ -478,7 +478,9 @@
 				});
 			});
 
+			
 			let volume = parseInt(localStorage.getItem("volume"));
+			if (!volume) localStorage.setItem("volume", 50);
 			volume = (typeof volume === "number") ? volume : 20;
 			$("#volumeSlider").val(volume);
 		},