mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-11-03 05:22:09 +08:00
fix(home): unify last check update timestamp across settings and home page (#6605)
The settings page "Check for updates" did not update the homepage "last check update time" because each page managed the timestamp independently. Centralizes the timestamp in the useUpdate hook via SWR + localStorage so both pages share a single data source. Closes https://github.com/clash-verge-rev/clash-verge-rev/issues/6605#issuecomment-4147144987
This commit is contained in:
@@ -4,6 +4,7 @@ import { useCallback, useRef } from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
|
||||
import { DialogRef, TooltipIcon } from '@/components/base'
|
||||
import { updateLastCheckTime } from '@/hooks/use-update'
|
||||
import {
|
||||
exitApp,
|
||||
exportDiagnosticInfo,
|
||||
@@ -45,6 +46,7 @@ const SettingVergeAdvanced = ({ onError: _ }: Props) => {
|
||||
const onCheckUpdate = async () => {
|
||||
try {
|
||||
const info = await checkUpdate()
|
||||
updateLastCheckTime()
|
||||
if (!info?.available) {
|
||||
showNotice.success(
|
||||
'settings.components.verge.advanced.notifications.latestVersion',
|
||||
|
||||
Reference in New Issue
Block a user