Compare commits
2
Commits
v1.2.0
...
4c71861813
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4c71861813 | ||
|
|
3a9f809f46 |
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "tallynote",
|
"name": "tallynote",
|
||||||
"version": "1.2.0",
|
"version": "1.2.2",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"packageManager": "pnpm@9.0.6",
|
"packageManager": "pnpm@9.0.6",
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ import {
|
|||||||
} from "lucide-react";
|
} from "lucide-react";
|
||||||
import { Button, Card, Dialog, RadioGroup, Radio, Steps, Tag, Tooltip } from "tdesign-react";
|
import { Button, Card, Dialog, RadioGroup, Radio, Steps, Tag, Tooltip } from "tdesign-react";
|
||||||
import { Page, Surface } from "../common";
|
import { Page, Surface } from "../common";
|
||||||
import { api } from "../../services/api";
|
import { api, ApiError } from "../../services/api";
|
||||||
import { dateText } from "../../utils/date";
|
import { dateText } from "../../utils/date";
|
||||||
import type { MockScenario, MockUpdateState } from "./mockData";
|
import type { MockScenario, MockUpdateState } from "./mockData";
|
||||||
|
|
||||||
@@ -420,7 +420,11 @@ export default function UpdatePage({
|
|||||||
setLiveInfo(await api<UpdateInfo>("/api/update/check", { method: "POST" }));
|
setLiveInfo(await api<UpdateInfo>("/api/update/check", { method: "POST" }));
|
||||||
notify?.("版本检查完成", "info");
|
notify?.("版本检查完成", "info");
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
setError((e as Error).message);
|
if (e instanceof ApiError && e.status === 429) {
|
||||||
|
notify?.((e as Error).message, "error");
|
||||||
|
} else {
|
||||||
|
setError((e as Error).message);
|
||||||
|
}
|
||||||
} finally {
|
} finally {
|
||||||
setChecking(false);
|
setChecking(false);
|
||||||
checkInFlight.current = false;
|
checkInFlight.current = false;
|
||||||
@@ -446,7 +450,8 @@ export default function UpdatePage({
|
|||||||
|
|
||||||
// Start download action
|
// Start download action
|
||||||
const startDownload = async () => {
|
const startDownload = async () => {
|
||||||
if (!latest) return;
|
if (!latest || actionInFlight.current || hasActiveJob || canApply) return;
|
||||||
|
actionInFlight.current = true;
|
||||||
setActionBusy(true);
|
setActionBusy(true);
|
||||||
setError("");
|
setError("");
|
||||||
setModalError("");
|
setModalError("");
|
||||||
@@ -465,12 +470,14 @@ export default function UpdatePage({
|
|||||||
notify?.(msg, "error");
|
notify?.(msg, "error");
|
||||||
} finally {
|
} finally {
|
||||||
setActionBusy(false);
|
setActionBusy(false);
|
||||||
|
actionInFlight.current = false;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Start apply action
|
// Start apply action
|
||||||
const startApply = async () => {
|
const startApply = async () => {
|
||||||
if (!latest) return;
|
if (!latest || !job || job.status !== "staged" || job.operation !== "download" || actionInFlight.current) return;
|
||||||
|
actionInFlight.current = true;
|
||||||
setActionBusy(true);
|
setActionBusy(true);
|
||||||
setError("");
|
setError("");
|
||||||
setModalError("");
|
setModalError("");
|
||||||
@@ -488,6 +495,7 @@ export default function UpdatePage({
|
|||||||
notify?.(msg, "error");
|
notify?.(msg, "error");
|
||||||
} finally {
|
} finally {
|
||||||
setActionBusy(false);
|
setActionBusy(false);
|
||||||
|
actionInFlight.current = false;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user