This commit is contained in:
@@ -451,7 +451,19 @@ export default function UpdatePage({
|
||||
setError("");
|
||||
try {
|
||||
const result = await api<UpdateInfo>("/api/update/check", { method: "POST" });
|
||||
mergeInfo(result, true);
|
||||
// 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.
|
||||
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,
|
||||
}));
|
||||
notify?.("版本检查完成", "info");
|
||||
} catch (e) {
|
||||
if (e instanceof ApiError && e.status === 429) {
|
||||
|
||||
Reference in New Issue
Block a user