Skip to content

Commit

Permalink
fix mention popup
Browse files Browse the repository at this point in the history
  • Loading branch information
reyamir committed Nov 26, 2023
1 parent 619bfb8 commit 34dceef
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/utils/hooks/useSuggestion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ export function useSuggestion() {
items: async ({ query }) => {
const users = await db.getAllCacheUsers();
return users
.filter((item) => item.name.toLowerCase().startsWith(query.toLowerCase()))
.filter((item) => {
if (item.name) return item.name.toLowerCase().startsWith(query.toLowerCase());
return item.displayName.toLowerCase().startsWith(query.toLowerCase());
})
.slice(0, 5);
},
render: () => {
Expand Down

0 comments on commit 34dceef

Please sign in to comment.