diff --git a/src/app.js b/src/app.js index 1215862..1618448 100644 --- a/src/app.js +++ b/src/app.js @@ -25,6 +25,7 @@ import { fetchData, postToServer } from '@/utils/api' import { toast } from '@/utils/toasts' import { isValidURL } from '@/utils/utils' import { sendAddToQueue } from '@/utils/downloads' +import { SPOTIFY_STATUS } from '@/constants' /* ===== App initialization ===== */ async function startApp() { @@ -36,9 +37,14 @@ async function startApp() { }).$mount('#app') const connectResponse = await (await fetch('connect')).json() - if (!connectResponse.deezerAvailable) document.getElementById('deezer_not_available').classList.remove('hide') + const spotifyStatus = connectResponse.spotifyEnabled ? SPOTIFY_STATUS.ENABLED : SPOTIFY_STATUS.DISABLED + + if (!connectResponse.deezerAvailable) { + document.getElementById('deezer_not_available').classList.remove('hide') + } store.dispatch('setAppInfo', connectResponse.update).catch(console.error) + store.dispatch('setSpotifyStatus', spotifyStatus).catch(console.error) let arl = localStorage.getItem('arl') const accessToken = localStorage.getItem('accessToken') diff --git a/src/components/pages/Favorites.vue b/src/components/pages/Favorites.vue index fd738ae..55a5d7b 100644 --- a/src/components/pages/Favorites.vue +++ b/src/components/pages/Favorites.vue @@ -198,7 +198,7 @@ export default defineComponent({ refreshFavorites } = useFavorites() - refreshFavorites({ isInitial: true }) + refreshFavorites({ isInitial: true }).catch(console.error) watch(isRefreshingFavorites, (newVal, oldVal) => { // If oldVal is true and newOne is false, it means that a refreshing has just terminated diff --git a/src/components/pages/Settings.vue b/src/components/pages/Settings.vue index 669ed2f..b32d70b 100644 --- a/src/components/pages/Settings.vue +++ b/src/components/pages/Settings.vue @@ -723,7 +723,7 @@