From 241670c9d0c63da99ab2229479d8c6f0b018adb6 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Sat, 21 Jan 2023 16:58:28 +0100 Subject: [PATCH] Handle parent/child update events through broadcast bus events --- .../src/components/panels/Entities/Entity.vue | 15 +++++++++++++-- .../src/components/panels/Entities/Index.vue | 6 ++++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/platypush/backend/http/webapp/src/components/panels/Entities/Entity.vue b/platypush/backend/http/webapp/src/components/panels/Entities/Entity.vue index 0bc566262..1307ef498 100644 --- a/platypush/backend/http/webapp/src/components/panels/Entities/Entity.vue +++ b/platypush/backend/http/webapp/src/components/panels/Entities/Entity.vue @@ -28,7 +28,6 @@ :value="entity" :loading="loading" :level="level + 1" - @update="setJustUpdated" @input="$emit('input', entity)" /> @@ -38,11 +37,12 @@ diff --git a/platypush/backend/http/webapp/src/components/panels/Entities/Index.vue b/platypush/backend/http/webapp/src/components/panels/Entities/Index.vue index c1fa989fd..a4fef4032 100644 --- a/platypush/backend/http/webapp/src/components/panels/Entities/Index.vue +++ b/platypush/backend/http/webapp/src/components/panels/Entities/Index.vue @@ -76,6 +76,7 @@ import NoItems from "@/components/elements/NoItems"; import Entity from "./Entity.vue"; import Selector from "./Selector.vue"; import EntityModal from "./Modal" +import { bus } from "@/bus"; import icons from '@/assets/icons.json' import meta from './meta.json' @@ -320,6 +321,7 @@ export default { } this.entities[entityId] = entity + bus.publishEntity(entity) }, onEntityDelete(event) { @@ -359,6 +361,10 @@ export default { await this.sync() await this.refresh() }, + + unmounted() { + this.unsubscribe('on-entity-update') + }, }