|  | @@ -34,67 +34,94 @@ export default {
 | 
	
		
			
				|  |  |  		}
 | 
	
		
			
				|  |  |  	},
 | 
	
		
			
				|  |  |  	mounted() {
 | 
	
		
			
				|  |  | -		this.socket.on("event:playlist.create", res => {
 | 
	
		
			
				|  |  | -			if (this.playlists.indexOf(res.data.playlist) === -1)
 | 
	
		
			
				|  |  | -				this.playlists.push(res.data.playlist);
 | 
	
		
			
				|  |  | -		});
 | 
	
		
			
				|  |  | +		this.socket.on(
 | 
	
		
			
				|  |  | +			"event:playlist.create",
 | 
	
		
			
				|  |  | +			res => this.playlists.push(res.data.playlist),
 | 
	
		
			
				|  |  | +			{ replaceable: true }
 | 
	
		
			
				|  |  | +		);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -		this.socket.on("event:playlist.delete", res => {
 | 
	
		
			
				|  |  | -			this.playlists.forEach((playlist, index) => {
 | 
	
		
			
				|  |  | -				if (playlist._id === res.data.playlistId) {
 | 
	
		
			
				|  |  | -					this.playlists.splice(index, 1);
 | 
	
		
			
				|  |  | -				}
 | 
	
		
			
				|  |  | -			});
 | 
	
		
			
				|  |  | -		});
 | 
	
		
			
				|  |  | +		this.socket.on(
 | 
	
		
			
				|  |  | +			"event:playlist.delete",
 | 
	
		
			
				|  |  | +			res => {
 | 
	
		
			
				|  |  | +				this.playlists.forEach((playlist, index) => {
 | 
	
		
			
				|  |  | +					if (playlist._id === res.data.playlistId) {
 | 
	
		
			
				|  |  | +						this.playlists.splice(index, 1);
 | 
	
		
			
				|  |  | +					}
 | 
	
		
			
				|  |  | +				});
 | 
	
		
			
				|  |  | +			},
 | 
	
		
			
				|  |  | +			{ replaceable: true }
 | 
	
		
			
				|  |  | +		);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -		this.socket.on("event:playlist.addSong", res => {
 | 
	
		
			
				|  |  | -			this.playlists.forEach((playlist, index) => {
 | 
	
		
			
				|  |  | -				if (playlist._id === res.data.playlistId) {
 | 
	
		
			
				|  |  | -					this.playlists[index].songs.push(res.data.song);
 | 
	
		
			
				|  |  | -				}
 | 
	
		
			
				|  |  | -			});
 | 
	
		
			
				|  |  | -		});
 | 
	
		
			
				|  |  | +		this.socket.on(
 | 
	
		
			
				|  |  | +			"event:playlist.addSong",
 | 
	
		
			
				|  |  | +			res => {
 | 
	
		
			
				|  |  | +				this.playlists.forEach((playlist, index) => {
 | 
	
		
			
				|  |  | +					if (playlist._id === res.data.playlistId) {
 | 
	
		
			
				|  |  | +						this.playlists[index].songs.push(res.data.song);
 | 
	
		
			
				|  |  | +					}
 | 
	
		
			
				|  |  | +				});
 | 
	
		
			
				|  |  | +			},
 | 
	
		
			
				|  |  | +			{ replaceable: true }
 | 
	
		
			
				|  |  | +		);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -		this.socket.on("event:playlist.removeSong", res => {
 | 
	
		
			
				|  |  | -			this.playlists.forEach((playlist, index) => {
 | 
	
		
			
				|  |  | -				if (playlist._id === res.data.playlistId) {
 | 
	
		
			
				|  |  | -					this.playlists[index].songs.forEach((song, index2) => {
 | 
	
		
			
				|  |  | -						if (song.youtubeId === res.data.youtubeId) {
 | 
	
		
			
				|  |  | -							this.playlists[index].songs.splice(index2, 1);
 | 
	
		
			
				|  |  | -						}
 | 
	
		
			
				|  |  | -					});
 | 
	
		
			
				|  |  | -				}
 | 
	
		
			
				|  |  | -			});
 | 
	
		
			
				|  |  | -		});
 | 
	
		
			
				|  |  | +		this.socket.on(
 | 
	
		
			
				|  |  | +			"event:playlist.removeSong",
 | 
	
		
			
				|  |  | +			res => {
 | 
	
		
			
				|  |  | +				this.playlists.forEach((playlist, index) => {
 | 
	
		
			
				|  |  | +					if (playlist._id === res.data.playlistId) {
 | 
	
		
			
				|  |  | +						this.playlists[index].songs.forEach((song, index2) => {
 | 
	
		
			
				|  |  | +							if (song.youtubeId === res.data.youtubeId) {
 | 
	
		
			
				|  |  | +								this.playlists[index].songs.splice(index2, 1);
 | 
	
		
			
				|  |  | +							}
 | 
	
		
			
				|  |  | +						});
 | 
	
		
			
				|  |  | +					}
 | 
	
		
			
				|  |  | +				});
 | 
	
		
			
				|  |  | +			},
 | 
	
		
			
				|  |  | +			{ replaceable: true }
 | 
	
		
			
				|  |  | +		);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -		this.socket.on("event:playlist.updateDisplayName", res => {
 | 
	
		
			
				|  |  | -			this.playlists.forEach((playlist, index) => {
 | 
	
		
			
				|  |  | -				if (playlist._id === res.data.playlistId) {
 | 
	
		
			
				|  |  | -					this.playlists[index].displayName = res.data.displayName;
 | 
	
		
			
				|  |  | -				}
 | 
	
		
			
				|  |  | -			});
 | 
	
		
			
				|  |  | -		});
 | 
	
		
			
				|  |  | +		this.socket.on(
 | 
	
		
			
				|  |  | +			"event:playlist.updateDisplayName",
 | 
	
		
			
				|  |  | +			res => {
 | 
	
		
			
				|  |  | +				this.playlists.forEach((playlist, index) => {
 | 
	
		
			
				|  |  | +					if (playlist._id === res.data.playlistId) {
 | 
	
		
			
				|  |  | +						this.playlists[index].displayName =
 | 
	
		
			
				|  |  | +							res.data.displayName;
 | 
	
		
			
				|  |  | +					}
 | 
	
		
			
				|  |  | +				});
 | 
	
		
			
				|  |  | +			},
 | 
	
		
			
				|  |  | +			{ replaceable: true }
 | 
	
		
			
				|  |  | +		);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -		this.socket.on("event:playlist.updatePrivacy", res => {
 | 
	
		
			
				|  |  | -			this.playlists.forEach((playlist, index) => {
 | 
	
		
			
				|  |  | -				if (playlist._id === res.data.playlist._id) {
 | 
	
		
			
				|  |  | -					this.playlists[index].privacy = res.data.playlist.privacy;
 | 
	
		
			
				|  |  | -				}
 | 
	
		
			
				|  |  | -			});
 | 
	
		
			
				|  |  | -		});
 | 
	
		
			
				|  |  | +		this.socket.on(
 | 
	
		
			
				|  |  | +			"event:playlist.updatePrivacy",
 | 
	
		
			
				|  |  | +			res => {
 | 
	
		
			
				|  |  | +				this.playlists.forEach((playlist, index) => {
 | 
	
		
			
				|  |  | +					if (playlist._id === res.data.playlist._id) {
 | 
	
		
			
				|  |  | +						this.playlists[index].privacy =
 | 
	
		
			
				|  |  | +							res.data.playlist.privacy;
 | 
	
		
			
				|  |  | +					}
 | 
	
		
			
				|  |  | +				});
 | 
	
		
			
				|  |  | +			},
 | 
	
		
			
				|  |  | +			{ replaceable: true }
 | 
	
		
			
				|  |  | +		);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -		this.socket.on("event:user.orderOfPlaylists.changed", res => {
 | 
	
		
			
				|  |  | -			const sortedPlaylists = [];
 | 
	
		
			
				|  |  | +		this.socket.on(
 | 
	
		
			
				|  |  | +			"event:user.orderOfPlaylists.changed",
 | 
	
		
			
				|  |  | +			res => {
 | 
	
		
			
				|  |  | +				const sortedPlaylists = [];
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -			this.playlists.forEach(playlist => {
 | 
	
		
			
				|  |  | -				sortedPlaylists[
 | 
	
		
			
				|  |  | -					res.data.order.indexOf(playlist._id)
 | 
	
		
			
				|  |  | -				] = playlist;
 | 
	
		
			
				|  |  | -			});
 | 
	
		
			
				|  |  | +				this.playlists.forEach(playlist => {
 | 
	
		
			
				|  |  | +					sortedPlaylists[
 | 
	
		
			
				|  |  | +						res.data.order.indexOf(playlist._id)
 | 
	
		
			
				|  |  | +					] = playlist;
 | 
	
		
			
				|  |  | +				});
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -			this.playlists = sortedPlaylists;
 | 
	
		
			
				|  |  | -			this.orderOfPlaylists = this.calculatePlaylistOrder();
 | 
	
		
			
				|  |  | -		});
 | 
	
		
			
				|  |  | +				this.playlists = sortedPlaylists;
 | 
	
		
			
				|  |  | +				this.orderOfPlaylists = this.calculatePlaylistOrder();
 | 
	
		
			
				|  |  | +			},
 | 
	
		
			
				|  |  | +			{ replaceable: true }
 | 
	
		
			
				|  |  | +		);
 | 
	
		
			
				|  |  |  	},
 | 
	
		
			
				|  |  |  	methods: {
 | 
	
		
			
				|  |  |  		calculatePlaylistOrder() {
 |