Added support for updates check

This commit is contained in:
RemixDev 2022-01-13 01:05:41 +01:00
parent f399df1285
commit 5ab3472a27
5 changed files with 25 additions and 6 deletions

View File

@ -89,6 +89,17 @@ async function startApp() {
} else {
loggedIn({ status: 3, user: connectResponse.currentUser, arl })
}
if (connectResponse.checkForUpdates) {
toast(i18n.t('toasts.checkingUpdates'), 'loading', false, 'updates-toast')
const updates = await fetchData('checkForUpdates')
store.dispatch('setUpdateInfo', updates).catch(console.error)
if (updates.updateAvailable) {
toast(i18n.t('toasts.updateAvailable'), 'chevron-triple-up', true, 'updates-toast')
} else {
toast(i18n.t('toasts.noUpdateAvailable'), 'done', true, 'updates-toast')
}
}
}
function initClient() {

View File

@ -33,9 +33,9 @@
<h2>{{ $t('about.titles.usefulLinks') }}</h2>
<ul class="no-dots">
<!-- <li>
<a href="" target="_blank">🌍 {{ $t('about.officialWebsite') }}</a>
</li> -->
<li>
<a href="https://deemix.app/gui" target="_blank">🌍 {{ $t('about.officialWebsite') }}</a>
</li>
<li>
<a href="https://git.freezer.life/RemixDev/deemix-js" target="_blank">🚀 {{ $t('about.officialRepo') }}</a>
</li>

View File

@ -217,7 +217,10 @@ const en = {
deezerNotAvailable: 'Deezer is not available in your country. You should use a VPN.',
startGeneratingItems: 'Processing {n} items...',
finishGeneratingItems: 'Generated {n} items.',
noLovedPlaylist: 'No loved tracks playlist!'
noLovedPlaylist: 'No loved tracks playlist!',
checkingUpdates: 'Checking for updates...',
noUpdateAvailable: 'No updates found',
updateAvailable: 'An update is available!'
},
settings: {
title: 'Settings',

View File

@ -217,7 +217,10 @@ const it = {
deezerNotAvailable: 'Deezer non è disponibile nel tuo paese. Dovresti usare una VPN.',
startGeneratingItems: 'Elaborando {n} oggetti...',
finishGeneratingItems: '{n} oggetti generati.',
noLovedPlaylist: 'Nessuna playlist "Canzoni del cuore"!'
noLovedPlaylist: 'Nessuna playlist "Canzoni del cuore"!',
checkingUpdates: 'Cercando aggiornamenti...',
noUpdateAvailable: 'Nessun aggiornamento trovato',
updateAvailable: 'È disponibile un aggiornamento!'
},
settings: {
title: 'Impostazioni',

View File

@ -39,9 +39,11 @@ const actions = {
*/
setAppInfo({ commit }, payload) {
commit('SET_CURRENT_COMMIT', payload.currentCommit)
commit('SET_DEEMIX_VERSION', payload.deemixVersion)
},
setUpdateInfo({ commit }, payload) {
commit('SET_LATEST_COMMIT', payload.latestCommit)
commit('SET_UPDATE_AVAILABLE', payload.updateAvailable)
commit('SET_DEEMIX_VERSION', payload.deemixVersion)
},
/**
* @param {any} action