diff --git a/src/pages/Zone/Card/ZoneLocationsTree.vue b/src/pages/Zone/Card/ZoneLocationsTree.vue
index 89231f75e..b0a97b2f6 100644
--- a/src/pages/Zone/Card/ZoneLocationsTree.vue
+++ b/src/pages/Zone/Card/ZoneLocationsTree.vue
@@ -42,16 +42,15 @@ const arrayData = useArrayData(datakey, {
const { store } = arrayData;
const storeData = computed(() => store.data);
-const nodes = ref([
- {
- id: null,
- name: props.rootLabel,
- sons: true,
- tickable: false,
- noTick: true,
- children: [{}],
- },
-]);
+const defaultNode = {
+ id: null,
+ name: props.rootLabel,
+ sons: true,
+ tickable: false,
+ noTick: true,
+ children: [{}],
+};
+const nodes = ref([defaultNode]);
const _tickedNodes = computed({
get: () => props.tickedNodes,
@@ -131,6 +130,7 @@ function getNodeIds(node) {
watch(storeData, async (val) => {
// Se triggerea cuando se actualiza el store.data, el cual es el resultado del fetch de la searchbar
+ if (!nodes.value[0]) nodes.value = [defaultNode];
nodes.value[0].childs = [...val];
const fetchedNodeKeys = val.flatMap(getNodeIds);
state.set('Tree', [...fetchedNodeKeys]);
@@ -196,7 +196,7 @@ onUnmounted(() => {
-
+