From a4e31c2446a75a64fd235b2240dbcf9e35bd6084 Mon Sep 17 00:00:00 2001 From: Jiajie Chen Date: Wed, 20 Mar 2024 20:07:21 +0800 Subject: [PATCH] fix: fix auto refresh timer handling --- frontend/src/pages/pipelines/index.vue | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/frontend/src/pages/pipelines/index.vue b/frontend/src/pages/pipelines/index.vue index 5c80699..e21a61d 100644 --- a/frontend/src/pages/pipelines/index.vue +++ b/frontend/src/pages/pipelines/index.vue @@ -249,11 +249,12 @@ }; }, watch: { - autoRefresh(newValue) { - if (newValue) { + autoRefresh(newValue, oldValue) { + if (newValue && !oldValue) { this.startAutoRefresh(); - } else { + } else if (!newValue && oldValue) { clearInterval(this.intervalHandle); + this.intervalHandle = null; } this.$router.push({path: this.$route.path, query: { @@ -292,7 +293,7 @@ this.serverItems = data.items; this.loading = false; - if (this.autoRefresh) { + if (this.autoRefresh && this.intervalHandle === null) { this.startAutoRefresh(); } }