fix: update fallback (#5115)

* fix: update fallback

* test: introduce Vitest and add semver helper tests

* chore: merge vitest config into vite
This commit is contained in:
Sline
2025-10-18 15:51:34 +08:00
committed by GitHub
parent 3d09cf0666
commit c465000178
10 changed files with 661 additions and 24 deletions

View File

@@ -1,9 +1,9 @@
import { Button } from "@mui/material";
import { check } from "@tauri-apps/plugin-updater";
import { useRef } from "react";
import useSWR from "swr";
import { useVerge } from "@/hooks/use-verge";
import { checkUpdateSafe } from "@/services/update";
import { DialogRef } from "../base";
import { UpdateViewer } from "../setting/mods/update-viewer";
@@ -21,7 +21,7 @@ export const UpdateButton = (props: Props) => {
const { data: updateInfo } = useSWR(
auto_check_update || auto_check_update === null ? "checkUpdate" : null,
check,
checkUpdateSafe,
{
errorRetryCount: 2,
revalidateIfStale: false,