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:
Tunglies
2026-09-16 09:14:12 +08:00
parent 619d6ae36a
commit 2f097790ed
3 changed files with 10 additions and 4 deletions
+2 -1
View File
@@ -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)
}
}
+5 -1
View File
@@ -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) {