Inherit the whole state object on message receive

This commit is contained in:
Skylar Grant 2024-12-07 14:29:26 -05:00
parent 8df32a5726
commit 38c0497a30

View File

@ -87,7 +87,7 @@ 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].on = msgJson.on; state[msgJson.name] = msgJson;
window.refreshState(window.document, state); window.refreshState(window.document, state);
}); });
} }