Make sure that minSearchStringLength is taken into account

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl 2020-02-03 11:59:10 +01:00
parent 4a5f18359f
commit e60d9e4312
No known key found for this signature in database
GPG Key ID: 4C614C6ED2CDE6DF
1 changed files with 5 additions and 1 deletions

View File

@ -96,6 +96,9 @@ export default {
loadingUsers: false,
selectedUser: null,
userSuggestions: {},
config: {
minSearchStringLength: parseInt(OC.config['sharing.minSearchStringLength'], 10) || 0,
},
}
},
computed: {
@ -128,6 +131,7 @@ export default {
},
created() {
this.findUserDebounced = debounce(this.findUser, 300)
this.findUser('')
},
methods: {
start() {
@ -152,7 +156,7 @@ export default {
async findUser(query) {
this.query = query.trim()
if (query.length < 3) {
if (query.length < this.config.minSearchStringLength) {
return
}