updated rollup plugin node-resolve; improved favorites refresh animation

This commit is contained in:
Roberto Tonino
2020-06-18 18:29:38 +02:00
parent 7682e85b87
commit 7484bf75cf
11 changed files with 79 additions and 53 deletions

View File

@@ -60,11 +60,11 @@ socket.on('logging_in', function () {
socket.on('init_autologin', function () {
let arl = localStorage.getItem('arl')
let accountNum = localStorage.getItem('accountNum')
if (arl){
if (arl) {
arl = arl.trim()
if (accountNum != 0){
if (accountNum != 0) {
socket.emit('login', arl, true, accountNum)
}else{
} else {
socket.emit('login', arl)
}
}
@@ -130,27 +130,27 @@ socket.on('logged_out', function () {
})
socket.on('cancellingCurrentItem', function (uuid) {
toast('Cancelling current item.', 'loading', false, 'cancelling_'+uuid)
toast('Cancelling current item.', 'loading', false, 'cancelling_' + uuid)
})
socket.on('currentItemCancelled', function (uuid) {
toast('Current item cancelled.', 'done', true, 'cancelling_'+uuid)
toast('Current item cancelled.', 'done', true, 'cancelling_' + uuid)
})
socket.on('startAddingArtist', function (data) {
toast(`Adding ${data.name} albums to queue`, 'loading', false, 'artist_'+data.id)
toast(`Adding ${data.name} albums to queue`, 'loading', false, 'artist_' + data.id)
})
socket.on('finishAddingArtist', function (data) {
toast(`Added ${data.name} albums to queue`, 'done', true, 'artist_'+data.id)
toast(`Added ${data.name} albums to queue`, 'done', true, 'artist_' + data.id)
})
socket.on('startConvertingSpotifyPlaylist', function (id) {
toast("Converting spotify tracks to deezer tracks", 'loading', false, 'spotifyplaylist_'+id)
toast('Converting spotify tracks to deezer tracks', 'loading', false, 'spotifyplaylist_' + id)
})
socket.on('finishConvertingSpotifyPlaylist', function (id) {
toast("Spotify playlist converted", 'done', true, 'spotifyplaylist_'+id)
toast('Spotify playlist converted', 'done', true, 'spotifyplaylist_' + id)
})
socket.on('errorMessage', function (error) {

View File

@@ -5,6 +5,7 @@ import Downloads from '../downloads.js'
import QualityModal from '../quality-modal.js'
import TrackPreview from '../track-preview.js'
import Utils from '../utils.js'
import { toast } from '../toasts'
const FavoritesTab = new Vue({
data() {
@@ -47,18 +48,29 @@ const FavoritesTab = new Vue({
updated_userTracks(data) {
this.tracks = data
},
reloadTabs(){
this.$refs.reloadButton.classList.add("spin")
reloadTabs() {
this.$refs.reloadButton.classList.add('spin')
socket.emit('update_userFavorites')
if (localStorage.getItem('spotifyUser')) socket.emit('update_userSpotifyPlaylists', localStorage.getItem('spotifyUser'))
if (localStorage.getItem('spotifyUser'))
socket.emit('update_userSpotifyPlaylists', localStorage.getItem('spotifyUser'))
},
updated_userFavorites(data){
updated_userFavorites(data) {
const { tracks, albums, artists, playlists } = data
this.tracks = tracks
this.albums = albums
this.artists = artists
this.playlists = playlists
this.$refs.reloadButton.classList.remove("spin")
// Removing animation class only when the animation has completed an iteration
// Prevents animation ugly stutter
this.$refs.reloadButton.addEventListener(
'animationiteration',
() => {
this.$refs.reloadButton.classList.remove('spin')
toast('Refresh completed!', 'done', true, 'favorites-refresh-toast')
},
{ once: true }
)
},
initFavorites(data) {
this.updated_userFavorites(data)