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>
Ferdinand Thiessen 2 weeks ago
parent 8269f55bed
commit 409b2badd4
No known key found for this signature in database
GPG Key ID: 45FAE7268762B400

@ -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
},
@ -614,15 +624,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…
Cancel
Save