Update:Show version number in bottom of siderail #660 and save previous version data to continue showing if update is available

This commit is contained in:
advplyr 2022-06-01 17:15:13 -05:00
parent c88bbf1ce4
commit 4621c78573
4 changed files with 83 additions and 30 deletions

View file

@ -23,14 +23,17 @@ function parseSemver(ver) {
}
return null
}
export const currentVersion = packagejson.version
export async function checkForUpdate() {
if (!packagejson.version) {
return
return null
}
var currVerObj = parseSemver('v' + packagejson.version)
if (!currVerObj) {
console.error('Invalid version', packagejson.version)
return
return null
}
var largestVer = null
await axios.get(`https://api.github.com/repos/advplyr/audiobookshelf/releases`).then((res) => {
@ -49,7 +52,7 @@ export async function checkForUpdate() {
})
if (!largestVer) {
console.error('No valid version tags to compare with')
return
return null
}
return {