mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-11-14 23:02:14 +08:00
fix(updater): install the already downloaded update instead of fetching it again
This commit is contained in:
@@ -15,7 +15,7 @@ import type { Options as ReactMarkdownOptions } from 'react-markdown'
|
||||
|
||||
import { BaseDialog, DialogRef } from '@/components/base'
|
||||
import { useUpdate } from '@/hooks/use-update'
|
||||
import { restartApp } from '@/services/cmds'
|
||||
import { installCachedUpdate, restartApp } from '@/services/cmds'
|
||||
import { showNotice } from '@/services/notice-service'
|
||||
import { useSetUpdateState, useUpdateState } from '@/services/states'
|
||||
import { openExternalUrl } from '@/utils/open-external-url'
|
||||
@@ -270,7 +270,9 @@ export function UpdateViewer({ ref }: { ref?: Ref<DialogRef> }) {
|
||||
}
|
||||
|
||||
try {
|
||||
await updateInfo.downloadAndInstall(onDownloadEvent)
|
||||
if (!(await installCachedUpdate(updateInfo.version))) {
|
||||
await updateInfo.downloadAndInstall(onDownloadEvent)
|
||||
}
|
||||
await restartApp()
|
||||
} catch (err: any) {
|
||||
showNotice.error(err)
|
||||
|
||||
Reference in New Issue
Block a user