bugfix for v1.6.0

This commit is contained in:
sanjayk03-dev
2025-09-07 00:14:57 +05:30
parent 28e6b29ed6
commit 5c46806c05

View File

@@ -120,21 +120,12 @@ module.exports = {
}, },
attached: function() { attached: function() {
// Sync all state values with motor config when component mounts // Sync all state values with motor config when component is ready
// This ensures UI shows correct values even if rotary was toggled on another page // This ensures UI shows correct values when component is first loaded
this.syncStateToConfig(); this.syncStateToConfig();
}, },
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']){
@@ -272,6 +263,7 @@ module.exports = {
const stateValue = this[stateKey]; const stateValue = this[stateKey];
if (stateValue === undefined) { if (stateValue === undefined) {
console.log(`State value for ${stateKey} is undefined`);
return; // Skip if state value is not defined return; // Skip if state value is not defined
} }