fix(core): Subscribe to navigation changes on mounted for Unified search

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
This commit is contained in:
Ferdinand Thiessen 2023-11-23 13:19:13 +01:00 committed by nextcloud-command
parent b092daa0f6
commit 076abb661b
5 changed files with 10 additions and 8 deletions

View file

@ -334,7 +334,6 @@ export default {
},
async created() {
subscribe('files:navigation:changed', this.onNavigationChange)
this.types = await getTypes()
this.logger.debug('Unified Search initialized with the following providers', this.types)
},
@ -344,6 +343,9 @@ export default {
},
mounted() {
// subscribe in mounted, as onNavigationChange relys on $el
subscribe('files:navigation:changed', this.onNavigationChange)
if (OCP.Accessibility.disableKeyboardShortcuts()) {
return
}
@ -383,7 +385,7 @@ export default {
},
onNavigationChange() {
this.$el.querySelector('form[role="search"]').reset()
this.$el?.querySelector?.('form[role="search"]')?.reset?.()
},
/**

4
dist/core-common.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long