From 25897f0a672637a24bf3ad342a27c6adfc6c8dcc Mon Sep 17 00:00:00 2001 From: sanjayk03-dev Date: Sun, 31 Aug 2025 18:21:35 +0530 Subject: [PATCH] added state handler --- src/js/motor-view.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/js/motor-view.js b/src/js/motor-view.js index b21af38..880d885 100644 --- a/src/js/motor-view.js +++ b/src/js/motor-view.js @@ -126,6 +126,15 @@ module.exports = { }, 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) { const motor_axes = ["X", "Y", "Z", "A", "B", "C"] if(motor_axes[new_value] != this.motor['axis']){