check update response (#785)
This commit is contained in:
parent
d790bf9916
commit
c43873f33b
1 changed files with 11 additions and 2 deletions
|
@ -168,17 +168,26 @@ async function isNewReleaseAvailable() {
|
|||
try {
|
||||
const response = await fetch('https://ollama.ai/api/update')
|
||||
|
||||
if (!response.ok) {
|
||||
return false
|
||||
}
|
||||
|
||||
if (response.status === 204) {
|
||||
return false
|
||||
}
|
||||
|
||||
const data = await response.json()
|
||||
|
||||
if (currentReleaseURL === data.url) {
|
||||
const url = data?.url
|
||||
if (!url) {
|
||||
return false
|
||||
}
|
||||
|
||||
currentReleaseURL = data.url
|
||||
if (url === currentReleaseURL) {
|
||||
return false
|
||||
}
|
||||
|
||||
currentReleaseURL = url
|
||||
return true
|
||||
} catch (error) {
|
||||
logger.error(`update check failed - ${error}`)
|
||||
|
|
Loading…
Add table
Reference in a new issue