Compare commits

...
1 Commits
Author SHA1 Message Date
Qiufeng 3ab3e5e180 fix: sync update status after checks
TallyNote release / linux-x64 (push) Successful in 6m54s
2026-09-05 16:41:18 +08:00
2 changed files with 7 additions and 10 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "tallynote", "name": "tallynote",
"version": "1.2.6", "version": "1.2.7",
"private": true, "private": true,
"type": "module", "type": "module",
"packageManager": "pnpm@9.0.6", "packageManager": "pnpm@9.0.6",
+6 -9
View File
@@ -451,18 +451,15 @@ export default function UpdatePage({
setError(""); setError("");
try { try {
const result = await api<UpdateInfo>("/api/update/check", { method: "POST" }); const result = await api<UpdateInfo>("/api/update/check", { method: "POST" });
// A check response is authoritative for release availability. It does // The check endpoint returns release metadata but not task state. Read
// not include a job field, so retain a task only while it is still // the status endpoint once more so reconciliation performed before the
// actionable; the status endpoint has already reconciled expired // check is authoritative: an expired staged task must disappear from
// staged tasks before this check runs. // this page immediately instead of surviving until a full refresh.
const status = await api<UpdateInfo>("/api/update/status");
setLiveInfo((current) => ({ setLiveInfo((current) => ({
...(current ?? result), ...(current ?? result),
...result, ...result,
job: current?.job && ( job: status.job,
current.job.status === "completed" ||
(current.job.status !== "staged" || current.job.operation !== "download") ||
(result.latest?.isNewer === true && result.latest.version === current.job.version)
) ? current.job : null,
})); }));
notify?.("版本检查完成", "info"); notify?.("版本检查完成", "info");
} catch (e) { } catch (e) {