From d7e05adb2439b16d7423fd5a1c9eafa2fa816b48 Mon Sep 17 00:00:00 2001 From: RemixDev Date: Sat, 12 Feb 2022 14:35:44 +0100 Subject: [PATCH] Added deezer unreachable differentiation to the vpn warning --- src/app.js | 6 ++++-- src/components/globals/DeezerWarning.vue | 19 +++++++++++++++---- src/lang/en.mjs | 1 + src/lang/it.mjs | 2 ++ 4 files changed, 22 insertions(+), 6 deletions(-) diff --git a/src/app.js b/src/app.js index d649831..6c25989 100644 --- a/src/app.js +++ b/src/app.js @@ -15,7 +15,6 @@ import '@/styles/css/icons.css' import '@/styles/css/tables.css' import '@/styles/css/typography.css' - import App from '@/App.vue' import i18n from '@/plugins/i18n' import router from '@/router' @@ -48,7 +47,10 @@ async function startApp() { const connectResponse = await (await fetch('connect')).json() const spotifyStatus = connectResponse.spotifyEnabled ? SPOTIFY_STATUS.ENABLED : SPOTIFY_STATUS.DISABLED - if (!connectResponse.deezerAvailable) { + if (connectResponse.deezerAvailable === 'no-network') { + document.getElementById('deezer_not_reachable').classList.remove('hide') + } + if (connectResponse.deezerAvailable === 'no') { document.getElementById('deezer_not_available').classList.remove('hide') } diff --git a/src/components/globals/DeezerWarning.vue b/src/components/globals/DeezerWarning.vue index f423b4e..cdcd564 100644 --- a/src/components/globals/DeezerWarning.vue +++ b/src/components/globals/DeezerWarning.vue @@ -1,6 +1,11 @@ @@ -8,16 +13,22 @@ #deezer_not_available { background-color: hsl(53, 98%, 47%); color: rgba(0, 0, 0, 0.75); +} +#deezer_not_reachable { + background-color: hsl(12, 98%, 46%); + color: rgba(255, 255, 255, 0.75); +} +.warning { padding: 8px 12px; margin: -10px 10px 0px; display: flex; border-radius: 8px; align-items: center; } -#deezer_not_available i { +.warning i { margin-right: 8px; } -#deezer_not_available.hide { +.hide { display: none !important; } diff --git a/src/lang/en.mjs b/src/lang/en.mjs index 5fe64ce..ee6816e 100644 --- a/src/lang/en.mjs +++ b/src/lang/en.mjs @@ -215,6 +215,7 @@ const en = { finishConvertingSpotifyPlaylist: 'Spotify playlist converted', loginNeededToDownload: 'You need to log in to download tracks!', deezerNotAvailable: 'Deezer is not available in your country. You should use a VPN.', + deezerNotReachable: "The app can't reach Deezer. Check your internet connection, your firewall or your antivirus.", startGeneratingItems: 'Processing {n} items...', finishGeneratingItems: 'Generated {n} items.', noLovedPlaylist: 'No loved tracks playlist!', diff --git a/src/lang/it.mjs b/src/lang/it.mjs index 974453a..13f16d4 100644 --- a/src/lang/it.mjs +++ b/src/lang/it.mjs @@ -215,6 +215,8 @@ const it = { finishConvertingSpotifyPlaylist: 'Playlist di spotify convertita', loginNeededToDownload: 'Devi accedere prima di poter scaricare brani!', deezerNotAvailable: 'Deezer non รจ disponibile nel tuo paese. Dovresti usare una VPN.', + deezerNotReachable: + "L'applicazione non riesce a contattare Deezer. Controlla la tua connessione internet, il tuo firewall o il tuo antivirus.", startGeneratingItems: 'Elaborando {n} oggetti...', finishGeneratingItems: '{n} oggetti generati.', noLovedPlaylist: 'Nessuna playlist "Canzoni del cuore"!',