forked from platypush/platypush
We should always update the entities cache on addEntity.
Updating the entity cache only when we receive an event from a root entity means that we lose events sent by individual child entities.
This commit is contained in:
parent
1020b63da7
commit
4223576016
1 changed files with 2 additions and 1 deletions
|
@ -168,10 +168,11 @@ export default {
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
addEntity(entity) {
|
addEntity(entity) {
|
||||||
|
this.entities[entity.id] = entity
|
||||||
|
|
||||||
if (entity.parent_id != null)
|
if (entity.parent_id != null)
|
||||||
return // Only group entities that have no parent
|
return // Only group entities that have no parent
|
||||||
|
|
||||||
this.entities[entity.id] = entity;
|
|
||||||
['id', 'type', 'category', 'plugin'].forEach((attr) => {
|
['id', 'type', 'category', 'plugin'].forEach((attr) => {
|
||||||
if (entity[attr] == null)
|
if (entity[attr] == null)
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in a new issue