Track and clear setTimeout in ConformanceSidebar watch on unmount

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-09 17:51:44 +08:00
parent 957f875377
commit 2349554a26

View File

@@ -394,8 +394,10 @@ watch(isSubmittedData, (newValue) => {
});
// When opening a rule file, display the saved options, rules, and time
let reportWatchTimerId = null;
watch(conformanceTempReportData, (newValue) => {
setTimeout(() => {
if (reportWatchTimerId) clearTimeout(reportWatchTimerId);
reportWatchTimerId = setTimeout(() => {
if (newValue !== null) {
const rule = newValue.rule;
@@ -1722,6 +1724,7 @@ emitter.on("isRadioActSeqFromToChange", (data) => {
// beforeUnmount
onBeforeUnmount(() => {
if (reportWatchTimerId) clearTimeout(reportWatchTimerId);
isSubmitReset();
selectTimeReset();
});