mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
fix(files): Debounce does not return a function so it should be used as computed
This also fixes hacky solution to `this` access Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
This commit is contained in:
parent
42001984f3
commit
dfd0fa673d
1 changed files with 10 additions and 9 deletions
|
|
@ -223,6 +223,16 @@ export default defineComponent({
|
|||
},
|
||||
|
||||
computed: {
|
||||
/**
|
||||
* Handle search event from unified search.
|
||||
*/
|
||||
onSearch() {
|
||||
return debounce((searchEvent: { query: string }) => {
|
||||
console.debug('Files app handling search event from unified search...', searchEvent)
|
||||
this.filterText = searchEvent.query
|
||||
}, 500)
|
||||
},
|
||||
|
||||
userConfig(): UserConfig {
|
||||
return this.userConfigStore.userConfig
|
||||
},
|
||||
|
|
@ -613,15 +623,6 @@ export default defineComponent({
|
|||
this.fetchContent()
|
||||
}
|
||||
},
|
||||
/**
|
||||
* Handle search event from unified search.
|
||||
*
|
||||
* @param searchEvent is event object.
|
||||
*/
|
||||
onSearch: debounce(function(searchEvent) {
|
||||
console.debug('Files app handling search event from unified search...', searchEvent)
|
||||
this.filterText = searchEvent.query
|
||||
}, 500),
|
||||
|
||||
/**
|
||||
* Reset the search query
|
||||
|
|
|
|||
Loading…
Reference in a new issue