Skip to content

Commit 94e0f83

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

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

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
/**

0 commit comments

Comments
 (0)