mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-10-15 05:40:47 +08:00
fix(updater): downgrade manual check failure notice to warning
Manual update-check failures surfaced as red error toasts that read as an app fault. Add a warning severity to the notice service and use it in both check entry points alongside a console.warn; automatic checks and install failures keep their existing behavior.
This commit is contained in:
@@ -108,7 +108,8 @@ export const SystemInfoCard = () => {
|
||||
goToSettings()
|
||||
}
|
||||
} catch (err) {
|
||||
showNotice.error(err)
|
||||
console.warn('update check failed:', err)
|
||||
showNotice.warning(err)
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
@@ -54,8 +54,9 @@ const SettingVergeAdvanced = ({ onError: _ }: Props) => {
|
||||
} else {
|
||||
updateRef.current?.open()
|
||||
}
|
||||
} catch (err: any) {
|
||||
showNotice.error(err)
|
||||
} catch (err) {
|
||||
console.warn('update check failed:', err)
|
||||
showNotice.warning(err)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import { ReactNode, isValidElement } from 'react'
|
||||
import type { FailedOperation } from '@/services/cmds'
|
||||
import type { TranslationKey } from '@/types/generated/i18n-keys'
|
||||
|
||||
type NoticeType = 'success' | 'error' | 'info'
|
||||
type NoticeType = 'success' | 'error' | 'info' | 'warning'
|
||||
|
||||
interface NoticeTranslationDescriptor {
|
||||
key: string
|
||||
@@ -47,6 +47,7 @@ type ShowNotice = ((
|
||||
success: NoticeShortcut
|
||||
error: NoticeShortcut
|
||||
info: NoticeShortcut
|
||||
warning: NoticeShortcut
|
||||
}
|
||||
|
||||
type NoticeSubscriber = () => void
|
||||
@@ -54,6 +55,7 @@ type NoticeSubscriber = () => void
|
||||
const DEFAULT_DURATIONS: Readonly<Record<NoticeType, number>> = {
|
||||
success: 3000,
|
||||
info: 5000,
|
||||
warning: 6000,
|
||||
error: 8000,
|
||||
}
|
||||
|
||||
@@ -509,6 +511,8 @@ export const showNotice: ShowNotice = Object.assign(baseShowNotice, {
|
||||
baseShowNotice('error', message, ...extras),
|
||||
info: (message: NoticeContent, ...extras: NoticeExtra[]) =>
|
||||
baseShowNotice('info', message, ...extras),
|
||||
warning: (message: NoticeContent, ...extras: NoticeExtra[]) =>
|
||||
baseShowNotice('warning', message, ...extras),
|
||||
})
|
||||
|
||||
export function hideNotice(id: number) {
|
||||
|
||||
Reference in New Issue
Block a user