Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3ab3e5e180 |
+1
-1
@@ -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",
|
||||||
|
|||||||
@@ -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) {
|
||||||
|
|||||||
Reference in New Issue
Block a user