Merge branch 'tusooa/1249-suggestor' into 'develop'

Make suggestor ignore users without valid names

Closes #1249

See merge request pleroma/pleroma-fe!1794
This commit is contained in:
HJ 2023-03-03 10:10:06 +00:00
commit 0842193957

View File

@ -94,8 +94,9 @@ export const suggestUsers = ({ dispatch, state }) => {
const newSuggestions = state.users.users.filter(
user =>
user.screen_name.toLowerCase().startsWith(noPrefix) ||
user.name.toLowerCase().startsWith(noPrefix)
user.screen_name && user.name && (
user.screen_name.toLowerCase().startsWith(noPrefix) ||
user.name.toLowerCase().startsWith(noPrefix))
).slice(0, 20).sort((a, b) => {
let aScore = 0
let bScore = 0