mirror of
https://github.com/outline/outline.git
synced 2026-11-29 08:39:20 +03:00
Ensure both people and documents are showin in mention menu with no search term
This commit is contained in:
1 parent
64106979ba
commit
cfdb213cc1
1 file changed
+4
-1
@@ -46,6 +46,8 @@ function MentionMenu({ search, isActive, ...rest }: Props) {
|
||||
const actorId = auth.currentUserId;
|
||||
const location = useLocation();
|
||||
const documentId = parseDocumentSlug(location.pathname);
|
||||
const maxResultsInSection = search ? 25 : 5;
|
||||
|
||||
const { data, loading, request } = useRequest<{
|
||||
documents: Document[];
|
||||
users: User[];
|
||||
@@ -69,6 +71,7 @@ function MentionMenu({ search, isActive, ...rest }: Props) {
|
||||
React.useEffect(() => {
|
||||
if (data && actorId && !loading) {
|
||||
const items = data.users
|
||||
.slice(0, maxResultsInSection)
|
||||
.map(
|
||||
(user) =>
|
||||
({
|
||||
@@ -100,7 +103,7 @@ function MentionMenu({ search, isActive, ...rest }: Props) {
|
||||
} as MentionItem)
|
||||
)
|
||||
.concat(
|
||||
data.documents.map(
|
||||
data.documents.slice(0, maxResultsInSection).map(
|
||||
(doc) =>
|
||||
({
|
||||
name: "mention",
|
||||
|
||||
Reference in new issue
Block a user