From 392a6dccbce5cb91dcdd12e8b483d1c2406fdecd Mon Sep 17 00:00:00 2001
From: Valentin Rigal <rigal@teklia.com>
Date: Tue, 10 Oct 2023 14:09:57 +0000
Subject: [PATCH] Avoid a race condition listing datasets before elementId
 being accessible

---
 src/components/Element/DetailsPanel.vue | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/src/components/Element/DetailsPanel.vue b/src/components/Element/DetailsPanel.vue
index 5896916d1..e293853a3 100644
--- a/src/components/Element/DetailsPanel.vue
+++ b/src/components/Element/DetailsPanel.vue
@@ -216,12 +216,7 @@ export default defineComponent({
          * or some element attributes are not displayed at all.
          */
         if (!this.element || this.element.id !== id || !this.element.rights || !this.element.classifications) this.retrieveElement({ id })
-      }
-    },
-    datasets: {
-      immediate: true,
-      async handler (value) {
-        if (value === null) this.listElementDatasets({ eltId: this.elementId })
+        if (!Array.isArray(this.elementDatasets[id])) this.listElementDatasets({ eltId: id })
       }
     },
     selectedNewClassification () {
-- 
GitLab