From 32daeedcf7d1daf7d06ef47704eb75ff948b913f Mon Sep 17 00:00:00 2001 From: Stefan Dej Date: Sat, 18 Jul 2020 19:32:12 +0200 Subject: [PATCH] bugfix: reload endstop status by changing the current page this closes #19 --- src/components/panels/Settings/EndstopPanel.vue | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/components/panels/Settings/EndstopPanel.vue b/src/components/panels/Settings/EndstopPanel.vue index cffecc78..7fa8d673 100644 --- a/src/components/panels/Settings/EndstopPanel.vue +++ b/src/components/panels/Settings/EndstopPanel.vue @@ -50,14 +50,15 @@ endstops: state => state.printer.endstops, }) }, + created() { + this.getEndstops(); + }, methods: { syncEndstops() { this.$store.commit('setLoadingEndstopStatus', true); this.$socket.sendObj('get_printer_query_endstops_status', { }, "responseEndstopStatus"); - } - }, - watch: { - endstops: function() { + }, + getEndstops() { this.sortEndstops = {}; let keys = Object.keys(this.endstops); @@ -68,6 +69,11 @@ this.sortEndstops[k] = this.endstops[k]; } } + }, + watch: { + endstops: function() { + this.getEndstops(); + } } } \ No newline at end of file