mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-11-24 22:52:15 +08:00
fix(update): show manual check result in update dialog (#8701)
Co-authored-by: susu-Sugar <214122492+susu-Sugar@users.noreply.github.com>
This commit is contained in:
@@ -31,6 +31,7 @@
|
||||
- 修复「外部控制器」复制成功的提示一闪而过
|
||||
- 修复订阅的规则、代理组、节点编辑器快速连续操作时条目可能重复或错位
|
||||
- 修复检测更新后又发布新版时,应用内更新失败
|
||||
- 修复关闭「自动检查更新」后,手动检查更新时弹窗空白
|
||||
- 修复订阅响应过大导致内存占用过高,限制单次下载为 4 MiB
|
||||
- 修复全局模式默认停在 `DIRECT` 或 `REJECT` 导致流量未经代理,现自动切换到第一个策略组
|
||||
- 修复订阅中未加引号的 REALITY `short-id`(如 `1234e123`)被误读为数字,导致订阅无法启用
|
||||
|
||||
@@ -245,7 +245,11 @@ const remarkGitHubAlerts = (labels: Record<GitHubAlertType, string>) => {
|
||||
return visit
|
||||
}
|
||||
|
||||
export function UpdateViewer({ ref }: { ref?: Ref<DialogRef> }) {
|
||||
export interface UpdateViewerRef extends DialogRef {
|
||||
open: (update?: Update | null) => void
|
||||
}
|
||||
|
||||
export function UpdateViewer({ ref }: { ref?: Ref<UpdateViewerRef> }) {
|
||||
const { t, i18n } = useTranslation()
|
||||
|
||||
const [open, setOpen] = useState(false)
|
||||
@@ -266,8 +270,8 @@ export function UpdateViewer({ ref }: { ref?: Ref<DialogRef> }) {
|
||||
const progress = total <= 0 ? 0 : Math.min((downloaded / total) * 100, 100)
|
||||
|
||||
useImperativeHandle(ref, () => ({
|
||||
open: () => {
|
||||
setRefreshedUpdate(undefined)
|
||||
open: (update) => {
|
||||
setRefreshedUpdate(update)
|
||||
setOpen(true)
|
||||
},
|
||||
close: () => setOpen(false),
|
||||
|
||||
@@ -26,7 +26,7 @@ import { LiteModeViewer } from './mods/lite-mode-viewer'
|
||||
import { MiscViewer } from './mods/misc-viewer'
|
||||
import { SettingItem, SettingList } from './mods/setting-comp'
|
||||
import { ThemeViewer } from './mods/theme-viewer'
|
||||
import { UpdateViewer } from './mods/update-viewer'
|
||||
import { UpdateViewer, type UpdateViewerRef } from './mods/update-viewer'
|
||||
|
||||
interface Props {
|
||||
onError?: (err: Error) => void
|
||||
@@ -40,7 +40,7 @@ const SettingVergeAdvanced = ({ onError: _ }: Props) => {
|
||||
const miscRef = useRef<DialogRef>(null)
|
||||
const themeRef = useRef<DialogRef>(null)
|
||||
const layoutRef = useRef<DialogRef>(null)
|
||||
const updateRef = useRef<DialogRef>(null)
|
||||
const updateRef = useRef<UpdateViewerRef>(null)
|
||||
const backupRef = useRef<DialogRef>(null)
|
||||
const liteModeRef = useRef<DialogRef>(null)
|
||||
|
||||
@@ -53,7 +53,7 @@ const SettingVergeAdvanced = ({ onError: _ }: Props) => {
|
||||
'settings.components.verge.advanced.notifications.latestVersion',
|
||||
)
|
||||
} else {
|
||||
updateRef.current?.open()
|
||||
updateRef.current?.open(info)
|
||||
}
|
||||
} catch (err) {
|
||||
console.warn('update check failed:', err)
|
||||
|
||||
Reference in New Issue
Block a user