Skip to content

Commit 076abb6

Browse files
susnuxnextcloud-command
authored andcommitted
fix(core): Subscribe to navigation changes on mounted for Unified search
Signed-off-by: Ferdinand Thiessen <[email protected]> Signed-off-by: nextcloud-command <[email protected]>
1 parent b092daa commit 076abb6

5 files changed

Lines changed: 10 additions & 8 deletions

File tree

core/src/views/UnifiedSearch.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,6 @@ export default {
334334
},
335335
336336
async created() {
337-
subscribe('files:navigation:changed', this.onNavigationChange)
338337
this.types = await getTypes()
339338
this.logger.debug('Unified Search initialized with the following providers', this.types)
340339
},
@@ -344,6 +343,9 @@ export default {
344343
},
345344
346345
mounted() {
346+
// subscribe in mounted, as onNavigationChange relys on $el
347+
subscribe('files:navigation:changed', this.onNavigationChange)
348+
347349
if (OCP.Accessibility.disableKeyboardShortcuts()) {
348350
return
349351
}
@@ -383,7 +385,7 @@ export default {
383385
},
384386
385387
onNavigationChange() {
386-
this.$el.querySelector('form[role="search"]').reset()
388+
this.$el?.querySelector?.('form[role="search"]')?.reset?.()
387389
},
388390
389391
/**

dist/core-common.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/core-common.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/core-unified-search.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/core-unified-search.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)