mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-08-14 01:08:22 +02:00
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:
@ -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 {
|
||||
|
Reference in New Issue
Block a user