Don't inherit the whole state, just on and feedrate

This commit is contained in:
Skylar Grant 2024-12-07 14:54:04 -05:00
parent 1117af20e9
commit a082ed183f

View File

@ -87,7 +87,8 @@ export class Communicator {
const msgJson = JSON.parse(msgStr); const msgJson = JSON.parse(msgStr);
console.log(`Message received on topic ${topic}: ${msgStr}`); console.log(`Message received on topic ${topic}: ${msgStr}`);
console.log(msgJson); console.log(msgJson);
state[msgJson.name] = msgJson; state[msgJson.name].on = msgJson.on;
if (msgJson.feedRate) state[msgJson.name].feedRate = msgJson.feedRate;
window.refreshState(window.document, state); window.refreshState(window.document, state);
}); });
} }