aboutsummaryrefslogtreecommitdiffstats
path: root/core/src
diff options
context:
space:
mode:
authorMaksim Sukharev <antreesy.web@gmail.com>2025-01-17 17:27:24 +0100
committerAndy Scherzinger <info@andy-scherzinger.de>2025-01-18 15:16:46 +0100
commit0f41c35c17717bb544b0fddb9de4202f9648cf0f (patch)
tree28133dea635abf3aca6694fd3ecc63e88308aa80 /core/src
parent7c1866362e4cfeb8a0729b9afce8ef3a222b1d02 (diff)
downloadnextcloud-server-0f41c35c17717bb544b0fddb9de4202f9648cf0f.tar.gz
nextcloud-server-0f41c35c17717bb544b0fddb9de4202f9648cf0f.zip
fix(UnifiedSearch): request data only when opening modal
Signed-off-by: Maksim Sukharev <antreesy.web@gmail.com>
Diffstat (limited to 'core/src')
-rw-r--r--core/src/components/UnifiedSearch/UnifiedSearchModal.vue25
1 files changed, 13 insertions, 12 deletions
diff --git a/core/src/components/UnifiedSearch/UnifiedSearchModal.vue b/core/src/components/UnifiedSearch/UnifiedSearchModal.vue
index 7400956f96b..09d3db52835 100644
--- a/core/src/components/UnifiedSearch/UnifiedSearchModal.vue
+++ b/core/src/components/UnifiedSearch/UnifiedSearchModal.vue
@@ -264,6 +264,7 @@ export default defineComponent({
contacts: [],
showDateRangeModal: false,
internalIsVisible: this.open,
+ initialized: false,
}
},
@@ -308,6 +309,18 @@ export default defineComponent({
// Load results when opened with already filled query
if (this.open) {
this.focusInput()
+ if (!this.initialized) {
+ Promise.all([getProviders(), getContacts({ searchTerm: '' })])
+ .then(([providers, contacts]) => {
+ this.providers = this.groupProvidersByApp([...providers, ...this.externalFilters])
+ this.contacts = this.mapContacts(contacts)
+ unifiedSearchLogger.debug('Search providers and contacts initialized:', { providers: this.providers, contacts: this.contacts })
+ this.initialized = true
+ })
+ .catch((error) => {
+ unifiedSearchLogger.error(error)
+ })
+ }
if (this.searchQuery) {
this.find(this.searchQuery)
}
@@ -324,18 +337,6 @@ export default defineComponent({
mounted() {
subscribe('nextcloud:unified-search:add-filter', this.handlePluginFilter)
- getProviders().then((providers) => {
- this.providers = providers
- this.externalFilters.forEach(filter => {
- this.providers.push(filter)
- })
- this.providers = this.groupProvidersByApp(this.providers)
- unifiedSearchLogger.debug('Search providers', { providers: this.providers })
- })
- getContacts({ searchTerm: '' }).then((contacts) => {
- this.contacts = this.mapContacts(contacts)
- unifiedSearchLogger.debug('Contacts', { contacts: this.contacts })
- })
},
methods: {
/**