fix: 停止后本月学时不再被旧缓存和实时数字来回改
This commit is contained in:
@@ -259,6 +259,9 @@ async function loadSummary() {
|
||||
if (!hadData) summaryState.value = "error";
|
||||
return;
|
||||
}
|
||||
const studying = studyControl.value.active || studyControl.value.started;
|
||||
if (studying && progressHours.value) parsed.month_hours = progressHours.value;
|
||||
else if (parsed.month_hours) progressHours.value = parsed.month_hours;
|
||||
summary.value = parsed;
|
||||
avatarBroken.value = false;
|
||||
summaryError.value = "";
|
||||
@@ -560,7 +563,8 @@ function applyStudyControl(payload: Record<string, unknown>) {
|
||||
message: typeof payload.message === "string" ? payload.message : "",
|
||||
workers: asWorkers(payload.workers),
|
||||
};
|
||||
if (typeof payload.month_hours === "string") {
|
||||
const studying = payload.active === true || payload.started === true;
|
||||
if (studying && typeof payload.month_hours === "string" && payload.month_hours) {
|
||||
progressHours.value = payload.month_hours;
|
||||
if (summary.value) summary.value = { ...summary.value, month_hours: payload.month_hours };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user