Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3ab3e5e180 |
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "tallynote",
|
||||
"version": "1.2.6",
|
||||
"version": "1.2.7",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"packageManager": "pnpm@9.0.6",
|
||||
|
||||
@@ -451,18 +451,15 @@ export default function UpdatePage({
|
||||
setError("");
|
||||
try {
|
||||
const result = await api<UpdateInfo>("/api/update/check", { method: "POST" });
|
||||
// A check response is authoritative for release availability. It does
|
||||
// not include a job field, so retain a task only while it is still
|
||||
// actionable; the status endpoint has already reconciled expired
|
||||
// staged tasks before this check runs.
|
||||
// The check endpoint returns release metadata but not task state. Read
|
||||
// the status endpoint once more so reconciliation performed before the
|
||||
// check is authoritative: an expired staged task must disappear from
|
||||
// this page immediately instead of surviving until a full refresh.
|
||||
const status = await api<UpdateInfo>("/api/update/status");
|
||||
setLiveInfo((current) => ({
|
||||
...(current ?? result),
|
||||
...result,
|
||||
job: current?.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,
|
||||
job: status.job,
|
||||
}));
|
||||
notify?.("版本检查完成", "info");
|
||||
} catch (e) {
|
||||
|
||||
Reference in New Issue
Block a user