mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-08-03 09:44:41 +02:00
Add version checker
This commit is contained in:
parent
a56b3a8096
commit
bd0e8518be
7 changed files with 120 additions and 5 deletions
|
@ -1,6 +1,7 @@
|
|||
import Vue from 'vue'
|
||||
import { checkForUpdate } from '@/plugins/version'
|
||||
|
||||
export const state = () => ({
|
||||
versionData: null,
|
||||
serverSettings: null,
|
||||
streamAudiobook: null,
|
||||
editModalTab: 'details',
|
||||
|
@ -39,10 +40,24 @@ export const actions = {
|
|||
console.error('Failed to update server settings', error)
|
||||
return false
|
||||
})
|
||||
},
|
||||
checkForUpdate({ commit }) {
|
||||
return checkForUpdate()
|
||||
.then((res) => {
|
||||
commit('setVersionData', res)
|
||||
return res
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error('Update check failed', error)
|
||||
return false
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export const mutations = {
|
||||
setVersionData(state, versionData) {
|
||||
state.versionData = versionData
|
||||
},
|
||||
setServerSettings(state, settings) {
|
||||
state.serverSettings = settings
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue