added state handler

This commit is contained in:
sanjayk03-dev
2025-08-31 18:21:35 +05:30
parent 91f8860320
commit 25897f0a67

View File

@@ -126,6 +126,15 @@ module.exports = {
}, },
watch: { watch: {
// Watch for state changes to handle late-arriving websocket data
state: {
handler: function() {
// Re-sync when state updates (e.g., when websocket data arrives)
this.syncStateToConfig();
},
deep: true
},
current_axis(new_value) { current_axis(new_value) {
const motor_axes = ["X", "Y", "Z", "A", "B", "C"] const motor_axes = ["X", "Y", "Z", "A", "B", "C"]
if(motor_axes[new_value] != this.motor['axis']){ if(motor_axes[new_value] != this.motor['axis']){