Skip to content

Commit

Permalink
fix: fix auto refresh timer handling
Browse files Browse the repository at this point in the history
  • Loading branch information
jiegec committed Mar 20, 2024
1 parent a9a9f47 commit a4e31c2
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions frontend/src/pages/pipelines/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down Expand Up @@ -292,7 +293,7 @@
this.serverItems = data.items;
this.loading = false;
if (this.autoRefresh) {
if (this.autoRefresh && this.intervalHandle === null) {
this.startAutoRefresh();
}
}
Expand Down

0 comments on commit a4e31c2

Please sign in to comment.