fixed about tab merge issues
This commit is contained in:
parent
7ea276992a
commit
82e45633f5
File diff suppressed because one or more lines are too long
@ -3,8 +3,8 @@
|
||||
<h2 class="page_heading">{{ $t('sidebar.about') }}</h2>
|
||||
<ul>
|
||||
<li>
|
||||
{{ $t('about.updates.currentVersion') }}: <span v-if="current">{{ current }}</span
|
||||
><span v-else>{{ $t('about.updates.versionNotAvailable') }}</span>
|
||||
{{ $t('about.updates.currentVersion') }}:
|
||||
<span>{{ current || $t('about.updates.versionNotAvailable') }}</span>
|
||||
</li>
|
||||
<li>{{ $t('about.updates.deemixVersion') }}: {{ deemixVersion }}</li>
|
||||
<li v-if="updateAvailable && latest">{{ $t('about.updates.updateAvailable', { version: latest }) }}</li>
|
||||
@ -203,6 +203,7 @@ ul {
|
||||
import { socket } from '@/utils/socket'
|
||||
import paypal from '@/assets/paypal.svg'
|
||||
import ethereum from '@/assets/ethereum.svg'
|
||||
import { mapGetters } from 'vuex'
|
||||
|
||||
export default {
|
||||
data: () => ({
|
||||
@ -213,6 +214,9 @@ export default {
|
||||
updateAvailable: false,
|
||||
deemixVersion: null
|
||||
}),
|
||||
computed: {
|
||||
...mapGetters(['getAboutInfo'])
|
||||
},
|
||||
methods: {
|
||||
initUpdate(data) {
|
||||
const { currentCommit, latestCommit, updateAvailable, deemixVersion } = data
|
||||
@ -223,7 +227,7 @@ export default {
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
socket.on('init_update', this.initUpdate)
|
||||
this.initUpdate(this.getAboutInfo)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<aside id="sidebar" role="navigation" @click="handleSidebarClick">
|
||||
<aside id="sidebar" role="navigation">
|
||||
<router-link
|
||||
tag="span"
|
||||
id="main_home_tablink"
|
||||
|
@ -7,6 +7,7 @@ import defaultSettings from '@/store/modules/defaultSettings'
|
||||
import spotifyCredentials from '@/store/modules/spotifyCredentials'
|
||||
import charts from '@/store/modules/charts'
|
||||
import favorites from '@/store/modules/favorites'
|
||||
import about from '@/store/modules/about'
|
||||
|
||||
// Load Vuex
|
||||
Vue.use(Vuex)
|
||||
@ -19,7 +20,8 @@ export default new Vuex.Store({
|
||||
defaultSettings,
|
||||
spotifyCredentials,
|
||||
charts,
|
||||
favorites
|
||||
favorites,
|
||||
about
|
||||
},
|
||||
strict: process.env.NODE_ENV !== 'production'
|
||||
})
|
||||
|
41
src/store/modules/about.js
Normal file
41
src/store/modules/about.js
Normal file
@ -0,0 +1,41 @@
|
||||
const state = {
|
||||
currentCommit: null,
|
||||
latestCommit: null,
|
||||
updateAvailable: false,
|
||||
deemixVersion: null
|
||||
}
|
||||
|
||||
const actions = {
|
||||
setAboutInfo({ commit }, payload) {
|
||||
commit('SET_CURRENT_COMMIT', payload.currentCommit)
|
||||
commit('SET_LATEST_COMMIT', payload.latestCommit)
|
||||
commit('SET_UPDATE_AVAILABLE', payload.updateAvailable)
|
||||
commit('SET_DEEMIX_VERSION', payload.deemixVersion)
|
||||
}
|
||||
}
|
||||
|
||||
const getters = {
|
||||
getAboutInfo: state => state
|
||||
}
|
||||
|
||||
const mutations = {
|
||||
SET_CURRENT_COMMIT: (state, payload) => {
|
||||
state.currentCommit = payload
|
||||
},
|
||||
SET_LATEST_COMMIT: (state, payload) => {
|
||||
state.latestCommit = payload
|
||||
},
|
||||
SET_UPDATE_AVAILABLE: (state, payload) => {
|
||||
state.updateAvailable = payload
|
||||
},
|
||||
SET_DEEMIX_VERSION: (state, payload) => {
|
||||
state.deemixVersion = payload
|
||||
}
|
||||
}
|
||||
|
||||
export default {
|
||||
state,
|
||||
getters,
|
||||
actions,
|
||||
mutations
|
||||
}
|
@ -23,3 +23,7 @@ socket.on('init_settings', (settings, credentials, defaults) => {
|
||||
socket.on('init_home', data => {
|
||||
store.dispatch('cacheHomeData', data)
|
||||
})
|
||||
|
||||
socket.on('init_update', data => {
|
||||
store.dispatch('setAboutInfo', data)
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user