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
@@ -2,7 +2,6 @@ import { Box, Button, LinearProgress } from "@mui/material";
import { Event, UnlistenFn } from "@tauri-apps/api/event";
import { relaunch } from "@tauri-apps/plugin-process";
import { open as openUrl } from "@tauri-apps/plugin-shell";
import { check as checkUpdate } from "@tauri-apps/plugin-updater";
import { useLockFn } from "ahooks";
import type { Ref } from "react";
import { useEffect, useImperativeHandle, useMemo, useState } from "react";
@@ -15,6 +14,7 @@ import { useListen } from "@/hooks/use-listen";
import { portableFlag } from "@/pages/_layout";
import { showNotice } from "@/services/noticeService";
import { useSetUpdateState, useUpdateState } from "@/services/states";
import { checkUpdateSafe as checkUpdate } from "@/services/update";
export function UpdateViewer({ ref }: { ref?: Ref<DialogRef> }) {
const { t } = useTranslation();
@@ -1,6 +1,5 @@
import { ContentCopyRounded } from "@mui/icons-material";
import { Typography } from "@mui/material";
import { check as checkUpdate } from "@tauri-apps/plugin-updater";
import { useCallback, useRef } from "react";
import { useTranslation } from "react-i18next";
@@ -15,6 +14,7 @@ import {
openLogsDir,
} from "@/services/cmds";
import { showNotice } from "@/services/noticeService";
import { checkUpdateSafe as checkUpdate } from "@/services/update";
import { version } from "@root/package.json";
import { BackupViewer } from "./mods/backup-viewer";