refactor: selfEntity patch
This commit is contained in:
parent
b63a15c8a4
commit
ec4732b15b
|
@ -183,8 +183,11 @@ function onMessage({type, payload}) {
|
|||
switch (type) {
|
||||
case 'state-update':
|
||||
const patch = unpacker.unpack(payload);
|
||||
if (payload.selfEntity) {
|
||||
selfEntity = payload.selfEntity;
|
||||
for (const step of patch) {
|
||||
const {op, path, value} = step;
|
||||
if ('add' === op && '/selfEntity' === path) {
|
||||
selfEntity = value;
|
||||
}
|
||||
}
|
||||
stateSynchronizer.patchState(patch);
|
||||
dirty = true;
|
||||
|
|
Loading…
Reference in New Issue
Block a user