chore(release): stage v1.7.55-alpha
This commit is contained in:
@@ -739,6 +739,10 @@ function showStatus(msg: string, isError = false) {
|
||||
setTimeout(() => { statusMessage.value = '' }, 8000)
|
||||
}
|
||||
|
||||
function errorMessage(e: unknown): string {
|
||||
return e instanceof Error ? e.message : String(e)
|
||||
}
|
||||
|
||||
async function loadStatus() {
|
||||
try {
|
||||
const res = await rpcClient.call<{
|
||||
@@ -814,7 +818,17 @@ async function downloadUpdate() {
|
||||
const sizeMB = (res.downloaded_bytes / 1_048_576).toFixed(1)
|
||||
showStatus(t('systemUpdate.downloadSuccess', { count: res.components_downloaded, size: sizeMB }))
|
||||
} catch (e) {
|
||||
showStatus(t('systemUpdate.downloadFailed'), true)
|
||||
const msg = errorMessage(e)
|
||||
if (/no update.*available/i.test(msg)) {
|
||||
updateInfo.value = null
|
||||
updateMethod.value = null
|
||||
downloaded.value = false
|
||||
updateInProgress.value = false
|
||||
await loadStatus()
|
||||
showStatus(t('systemUpdate.upToDateMessage'))
|
||||
} else {
|
||||
showStatus(`${t('systemUpdate.downloadFailed')} ${msg}`, true)
|
||||
}
|
||||
if (import.meta.env.DEV) console.warn('Download failed', e)
|
||||
} finally {
|
||||
clearInterval(progressInterval)
|
||||
|
||||
Reference in New Issue
Block a user