fix: spotify user detected as logged in when only spotify id is saved, causing favorites rendering errors; chore: removed logs

This commit is contained in:
Roberto Tonino 2021-06-02 16:25:55 +02:00
parent 58642b6d48
commit 923f5355ed
7 changed files with 15 additions and 23 deletions

File diff suppressed because one or more lines are too long

View File

@ -220,14 +220,11 @@ export default {
queue: initQueueList,
restored
} = data
console.log({ initQueueList })
const initQueueComplete = Object.values(initQueueList)
.filter(el => ['completed', 'withErrors', 'failed'].includes(el.status))
.map(el => el.uuid)
console.log({ initQueueComplete })
if (initQueueComplete && initQueueComplete.length) {
initQueueComplete.forEach(item => {
initQueueList[item].silent = true

View File

@ -124,7 +124,6 @@ export default {
},
methods: {
showSearchbarMenu(url) {
console.log(url)
const searchbar = document.getElementById('searchbar')
searchbar.dataset.cmLink = url
const contextMenuEvent = {

View File

@ -27,7 +27,7 @@
<div v-if="playlists.length == 0">
<h1>{{ $t('favorites.noPlaylists') }}</h1>
</div>
<div v-if="playlists.length > 0 || spotifyPlaylists > 0" class="release-grid">
<div v-if="playlists.length > 0 || spotifyPlaylists.length > 0" class="release-grid">
<div v-for="release in playlists" :key="release.id" class="release">
<router-link :to="{ name: 'Playlist', params: { id: release.id } }" class="cursor-pointer" tag="div">
<CoverContainer :cover="release.picture_medium" :link="release.link" is-rounded @click.stop="addToQueue" />
@ -63,7 +63,7 @@
</div>
<div v-show="activeTab === 'album'">
<div v-if="albums.length == 0">
<div v-if="albums.length === 0">
<h1>{{ $t('favorites.noAlbums') }}</h1>
</div>
<div v-if="albums.length > 0" class="release-grid">
@ -183,7 +183,7 @@ export default defineComponent({
BaseTabs,
BaseTab
},
setup(props, ctx) {
setup(_, ctx) {
const state = reactive({
activeTab: 'playlist',
tabs: ['playlist', 'album', 'artist', 'track']
@ -251,7 +251,6 @@ export default defineComponent({
},
getActiveRelease(tab = this.activeTab) {
let toDownload
// console.log({ tab, play: this.playlists })
switch (tab) {
case 'playlist':

View File

@ -191,12 +191,9 @@ export default defineComponent({
const currentTabKey = `${type}Tab`
let next = total
// console.log({ currentTabKey, test: state.currentTab.searchType })
if (nextResult) {
next = parseInt(nextResult.match(/index=(\d*)/)[1])
}
// console.log({ next, total, type, newData })
if (state.results[currentTabKey].total !== total) {
state.results[currentTabKey].total = total

View File

@ -81,7 +81,7 @@ const getters = {
getClientMode: state => state.clientMode,
isLoggedIn: state => !!state.arl,
isLoggedWithSpotify: state => !!state.spotifyUser.id
isLoggedWithSpotify: state => !!state.spotifyUser.id && !!state.spotifyUser.name
}
const mutations = {

View File

@ -12,7 +12,7 @@ class CustomSocket extends WebSocket {
on(key, cb) {
if (!Object.keys(this.listeners).includes(key)) {
console.log('on:', key)
// console.log('on:', key)
this.listeners[key] = cb
this.addEventListener('message', event => {
@ -27,7 +27,7 @@ class CustomSocket extends WebSocket {
off(key) {
if (Object.keys(this.listeners).includes(key)) {
console.log('off:', key)
// console.log('off:', key)
this.removeEventListener('message', this.listeners[key])
delete this.listeners[key]
}