From 5fa6788357ed96c8bb7c5c9f902c474e513d26e1 Mon Sep 17 00:00:00 2001 From: Soulter <905617992@qq.com> Date: Mon, 21 Apr 2025 10:54:06 +0800 Subject: [PATCH] chore: properly storing interval ID for cleanup. --- dashboard/src/views/ToolUsePage.vue | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/dashboard/src/views/ToolUsePage.vue b/dashboard/src/views/ToolUsePage.vue index edac815e2..fe546a2b9 100644 --- a/dashboard/src/views/ToolUsePage.vue +++ b/dashboard/src/views/ToolUsePage.vue @@ -486,6 +486,7 @@ export default { }, data() { return { + refreshInterval: null, activeTab: 'local', // 当前激活的标签页 mcpServers: [], tools: [], @@ -575,8 +576,10 @@ export default { }, unmounted() { - // 清除定时器 - clearInterval(this.refreshInterval); + // 清除定时器 if it exists + if (this.refreshInterval) { + clearInterval(this.refreshInterval); + } }, methods: {