Merge branch 'feat/tweak-autocomplete-search' into 'develop'

Autocomplete tweaks: remove search blocker, fix debounce params #869

See merge request pleroma/pleroma-fe!1149
This commit is contained in:
lain 2020-06-18 11:29:50 +00:00
commit 2ea5bff3a7
3 changed files with 7 additions and 6 deletions

View File

@ -32,6 +32,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Uploading and drag-dropping multiple files works correctly now.
- Subject field now appears disabled when posting
- Fix status ellipsis menu being cut off in notifications column
- Fixed autocomplete sometimes not returning the right user when there's already some results
## [2.0.3] - 2020-05-02
### Fixed

View File

@ -13,7 +13,7 @@ import { debounce } from 'lodash'
const debounceUserSearch = debounce((data, input) => {
data.updateUsersList(input)
}, 500, { leading: true, trailing: false })
}, 500)
export default data => input => {
const firstChar = input[0]
@ -97,8 +97,8 @@ export const suggestUsers = data => input => {
replacement: '@' + screen_name + ' '
}))
// BE search users if there are no matches
if (newUsers.length === 0 && data.updateUsersList) {
// BE search users to get more comprehensive results
if (data.updateUsersList) {
debounceUserSearch(data, noPrefix)
}
return newUsers

View File

@ -428,10 +428,10 @@ const users = {
store.commit('setUserForNotification', notification)
})
},
searchUsers (store, { query }) {
return store.rootState.api.backendInteractor.searchUsers({ query })
searchUsers ({ rootState, commit }, { query }) {
return rootState.api.backendInteractor.searchUsers({ query })
.then((users) => {
store.commit('addNewUsers', users)
commit('addNewUsers', users)
return users
})
},