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