From 2349554a261fe0c33799b6fa02171342b0118cc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BE=9D=E7=91=AA=E8=B2=93?= Date: Mon, 9 Mar 2026 17:51:44 +0800 Subject: [PATCH] Track and clear setTimeout in ConformanceSidebar watch on unmount Co-Authored-By: Claude Opus 4.6 --- src/components/Discover/Conformance/ConformanceSidebar.vue | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/Discover/Conformance/ConformanceSidebar.vue b/src/components/Discover/Conformance/ConformanceSidebar.vue index 42b216f..0d371dd 100644 --- a/src/components/Discover/Conformance/ConformanceSidebar.vue +++ b/src/components/Discover/Conformance/ConformanceSidebar.vue @@ -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(); });