chore: properly storing interval ID for cleanup.

This commit is contained in:
Soulter
2025-04-21 10:54:06 +08:00
parent c5c5a98ac4
commit 5fa6788357
+5 -2
View File
@@ -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: {