From 426db32bbc702c4cd42a0f5a29dcbc481e6eb7ea Mon Sep 17 00:00:00 2001 From: Alexey Velikiy Date: Mon, 1 Nov 2021 12:12:14 +0300 Subject: [PATCH] bad update on deletion #32 --- client/src/components/Graph.vue | 7 +++++-- client/src/components/hastic_pod/index.ts | 3 +-- client/src/views/Home.vue | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/client/src/components/Graph.vue b/client/src/components/Graph.vue index f3678d3..49f7b11 100644 --- a/client/src/components/Graph.vue +++ b/client/src/components/Graph.vue @@ -89,9 +89,12 @@ export default defineComponent({ this.pod.render(); }, methods: { - async rerender() { - await _deleteSegment.bind(this)(0, Date.now()); + rerender() { this.pod.fetchData(); + }, + async deleteAllSegments() { + await _deleteSegment.bind(this)(0, Date.now()); + this.rerender(); } } }); diff --git a/client/src/components/hastic_pod/index.ts b/client/src/components/hastic_pod/index.ts index da3b082..79f8f60 100644 --- a/client/src/components/hastic_pod/index.ts +++ b/client/src/components/hastic_pod/index.ts @@ -96,8 +96,8 @@ export class HasticPod extends LinePod { this._udc({ from, to }) .then(resp => { - this.updateData(resp.timeserie); this.updateSegments(resp.segments); + this.updateData(resp.timeserie); }) .catch(() => { /* set "error" message */ }) } @@ -244,7 +244,6 @@ export class HasticPod extends LinePod { protected updateSegments(segments: Segment[]): void { this._segmentSet.clear(); this._segmentSet.setSegments(segments); - this.renderSegments(); } diff --git a/client/src/views/Home.vue b/client/src/views/Home.vue index 2d74f2a..0f48f60 100644 --- a/client/src/views/Home.vue +++ b/client/src/views/Home.vue @@ -30,7 +30,7 @@ export default defineComponent({ }, methods: { clearAllLabeling() { - this.$refs.graph.rerender(); + this.$refs.graph.deleteAllSegments(); } } });