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