fix user suggestor
This commit is contained in:
parent
e6ef8e8017
commit
afdf22675f
1 changed files with 3 additions and 2 deletions
|
|
@ -1,4 +1,5 @@
|
||||||
import { useSearchStore } from 'src/stores/search.js'
|
import { useSearchStore } from 'src/stores/search.js'
|
||||||
|
import { useUsersStore } from 'src/stores/users.js'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* suggest - generates a suggestor function to be used by emoji-input
|
* suggest - generates a suggestor function to be used by emoji-input
|
||||||
|
|
@ -71,7 +72,7 @@ export const suggestEmoji = (emojis) => (input, nameKeywordLocalizer) => {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export const suggestUsers = ({ dispatch, state }) => {
|
export const suggestUsers = () => {
|
||||||
// Keep some persistent values in closure, most importantly for the
|
// Keep some persistent values in closure, most importantly for the
|
||||||
// custom debounce to work. Lodash debounce does not return a promise.
|
// custom debounce to work. Lodash debounce does not return a promise.
|
||||||
let suggestions = []
|
let suggestions = []
|
||||||
|
|
@ -107,7 +108,7 @@ export const suggestUsers = ({ dispatch, state }) => {
|
||||||
await debounceUserSearch(noPrefix)
|
await debounceUserSearch(noPrefix)
|
||||||
}
|
}
|
||||||
|
|
||||||
const newSuggestions = state.users.users
|
const newSuggestions = [...useUsersStore().users.values()]
|
||||||
.filter(
|
.filter(
|
||||||
(user) =>
|
(user) =>
|
||||||
user.screen_name &&
|
user.screen_name &&
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue