Track and clear setTimeout in ConformanceSidebar watch on unmount
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -394,8 +394,10 @@ watch(isSubmittedData, (newValue) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// When opening a rule file, display the saved options, rules, and time
|
// When opening a rule file, display the saved options, rules, and time
|
||||||
|
let reportWatchTimerId = null;
|
||||||
watch(conformanceTempReportData, (newValue) => {
|
watch(conformanceTempReportData, (newValue) => {
|
||||||
setTimeout(() => {
|
if (reportWatchTimerId) clearTimeout(reportWatchTimerId);
|
||||||
|
reportWatchTimerId = setTimeout(() => {
|
||||||
if (newValue !== null) {
|
if (newValue !== null) {
|
||||||
const rule = newValue.rule;
|
const rule = newValue.rule;
|
||||||
|
|
||||||
@@ -1722,6 +1724,7 @@ emitter.on("isRadioActSeqFromToChange", (data) => {
|
|||||||
|
|
||||||
// beforeUnmount
|
// beforeUnmount
|
||||||
onBeforeUnmount(() => {
|
onBeforeUnmount(() => {
|
||||||
|
if (reportWatchTimerId) clearTimeout(reportWatchTimerId);
|
||||||
isSubmitReset();
|
isSubmitReset();
|
||||||
selectTimeReset();
|
selectTimeReset();
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user