From 0dd185a835f5cba94c3395083b8f9941e4f976dc Mon Sep 17 00:00:00 2001 From: mateuswetah Date: Mon, 15 Jun 2020 16:22:19 -0300 Subject: [PATCH] Immediate update to isLoadingItems watchers. --- .../admin/components/filter-types/tainacan-filter-item.vue | 2 +- .../admin/components/filter-types/taxonomy/Checkbox.vue | 7 +++++-- .../admin/components/filter-types/taxonomy/Taginput.vue | 7 +++++-- src/views/admin/components/search/filters-items-list.vue | 2 +- src/views/admin/js/filter-types-mixin.js | 7 +++++-- 5 files changed, 17 insertions(+), 8 deletions(-) diff --git a/src/views/admin/components/filter-types/tainacan-filter-item.vue b/src/views/admin/components/filter-types/tainacan-filter-item.vue index 52d3200c9..0e98072ae 100644 --- a/src/views/admin/components/filter-types/tainacan-filter-item.vue +++ b/src/views/admin/components/filter-types/tainacan-filter-item.vue @@ -55,7 +55,7 @@ query: Object, isRepositoryLevel: Boolean, open: true, - isLoadingItems: false, + isLoadingItems: true, }, data() { return { diff --git a/src/views/admin/components/filter-types/taxonomy/Checkbox.vue b/src/views/admin/components/filter-types/taxonomy/Checkbox.vue index 069c4e1dc..40c3fdfbc 100644 --- a/src/views/admin/components/filter-types/taxonomy/Checkbox.vue +++ b/src/views/admin/components/filter-types/taxonomy/Checkbox.vue @@ -86,8 +86,11 @@ if (this.isUsingElasticSearch) this.loadOptions(); }, - isLoadingItems() { - this.isLoadingOptions = this.isLoadingItems; + isLoadingItems: { + handler() { + this.isLoadingOptions = this.isLoadingItems; + }, + immediate: true }, 'query'() { this.loadOptions(); diff --git a/src/views/admin/components/filter-types/taxonomy/Taginput.vue b/src/views/admin/components/filter-types/taxonomy/Taginput.vue index 597134b3a..ca53694d5 100644 --- a/src/views/admin/components/filter-types/taxonomy/Taginput.vue +++ b/src/views/admin/components/filter-types/taxonomy/Taginput.vue @@ -59,8 +59,11 @@ } }, watch: { - isLoadingItems() { - this.isLoadingOptions = this.isLoadingItems; + isLoadingItems: { + handler() { + this.isLoadingOptions = this.isLoadingItems; + }, + immediate: true }, 'query'() { this.updateSelectedValues(); diff --git a/src/views/admin/components/search/filters-items-list.vue b/src/views/admin/components/search/filters-items-list.vue index 78759b282..b69b8f24a 100644 --- a/src/views/admin/components/search/filters-items-list.vue +++ b/src/views/admin/components/search/filters-items-list.vue @@ -291,7 +291,7 @@ }, data() { return { - isLoadingItems: false, + isLoadingItems: true, isLoadingFilters: false, collapseAll: false, taxonomyFiltersCollectionNames: {}, diff --git a/src/views/admin/js/filter-types-mixin.js b/src/views/admin/js/filter-types-mixin.js index 1a4dd8f2d..0825b30b6 100644 --- a/src/views/admin/js/filter-types-mixin.js +++ b/src/views/admin/js/filter-types-mixin.js @@ -48,8 +48,11 @@ export const dynamicFilterTypeMixin = { } }, watch: { - isLoadingItems() { - this.isLoadingOptions = this.isLoadingItems; + isLoadingItems: { + handler() { + this.isLoadingOptions = this.isLoadingItems; + }, + immediate: true } }, methods: {