From 171ed7f743b2616304bfcfb29ee77cb55325aad6 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Fri, 29 Dec 2023 03:45:17 +0100 Subject: [PATCH] [Entities UI] Better refresh logic. --- .../webapp/src/components/panels/Entities/Index.vue | 11 +++-------- platypush/plugins/assistant/__init__.py | 2 +- 2 files changed, 4 insertions(+), 9 deletions(-) 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 01c56dc6..e70798e2 100644 --- a/platypush/backend/http/webapp/src/components/panels/Entities/Index.vue +++ b/platypush/backend/http/webapp/src/components/panels/Entities/Index.vue @@ -426,14 +426,9 @@ export default { 'platypush.message.event.entities.EntityDeleteEvent' ) - if (!this.loadCachedEntities()) { - await this.sync() - this.refresh() - } else { - await this.request('entities.scan') - this.sync() - } - + const hasCachedEntities = this.loadCachedEntities() + await this.sync(!hasCachedEntities) + await this.refresh() setInterval(() => this.refreshEntitiesCache(), 10000) }, diff --git a/platypush/plugins/assistant/__init__.py b/platypush/plugins/assistant/__init__.py index 0c88d838..bb5b25e4 100644 --- a/platypush/plugins/assistant/__init__.py +++ b/platypush/plugins/assistant/__init__.py @@ -278,7 +278,7 @@ class AssistantPlugin(Plugin, AssistantEntityManager, ABC): else: self._on_unmute() - def transform_entities(self, entities: Collection['AssistantPlugin']): + def transform_entities(self, entities: Collection['AssistantPlugin'], **_): return super().transform_entities( [ Assistant(