Prechádzať zdrojové kódy

Fixed issues with searching and edit station modal.

KrisVos130 8 rokov pred
rodič
commit
1c759a60ac

+ 6 - 5
backend/logic/actions/apis.js

@@ -1,10 +1,11 @@
 'use strict';
 
-const request = require('request'),
-	  config  = require('config'),
-		utils = require('../utils'),
-	   logger = require('../logger'),
-		hooks = require('./hooks');
+const 	request = require('request'),
+		config  = require('config'),
+		async 	= require('async'),
+		utils 	= require('../utils'),
+		logger 	= require('../logger'),
+		hooks 	= require('./hooks');
 
 module.exports = {
 

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

@@ -859,7 +859,7 @@ module.exports = {
 			logger.success("STATIONS_SELECT_PRIVATE_PLAYLIST", `Selected private playlist "${playlistId}" for station "${stationId}" successfully.`);
 			if (!station.partyMode) stations.skipStation(stationId)();
 			cache.pub('privatePlaylist.selected', {playlistId, stationId});
-			return cb({'status': 'success', 'message': 'Successfully got queue.'});
+			return cb({'status': 'success', 'message': 'Successfully selected playlist.'});
 		});
 	}),
 };

+ 6 - 4
frontend/components/Modals/EditStation.vue

@@ -140,10 +140,6 @@
 		},
 		ready: function () {
 			let _this = this;
-			for (let prop in _this.editing) {
-				console.log(prop, _this.editing[prop]);
-				_this.editing[prop] = _this.$parent.station[prop];
-			}
 			io.getSocket(socket => {
 				_this.socket = socket;
 			});
@@ -151,6 +147,12 @@
 		events: {
 			closeModal: function() {
 				this.$parent.modals.editStation = false;
+			},
+			editStation: function(station) {
+				for (let prop in station) {
+					this.editing[prop] = station[prop];
+				}
+				this.$parent.modals.editStation = true;
 			}
 		},
 		components: { Modal }

+ 1 - 1
frontend/components/Station/Station.vue

@@ -144,7 +144,7 @@
 					privacy: _this.station.privacy,
 					displayName: _this.station.displayName
 				});
-				this.modals.editStation = !this.modals.editStation;
+				//this.modals.editStation = !this.modals.editStation;
 			},
 			toggleSidebar: function (type) {
 				Object.keys(this.sidebars).forEach(sidebar => {