Skip to content
Snippets Groups Projects
Unverified Commit e8da11c1 authored by Raphael Krut-Landau's avatar Raphael Krut-Landau Committed by GitHub
Browse files

Don't include blank actions in the entitymenu (#40111)

Fixes a problem introduced in #39782
parent a94ece6f
No related branches found
No related tags found
No related merge requests found
...@@ -106,26 +106,36 @@ function EntityItemMenu({ ...@@ -106,26 +106,36 @@ function EntityItemMenu({
const actions = useMemo(() => { const actions = useMemo(() => {
const result = []; const result = [];
const bookmarkAction = { const bookmarkAction = onToggleBookmark
title: isBookmarked ? t`Remove from bookmarks` : t`Bookmark`, ? {
icon: "bookmark", title: isBookmarked ? t`Remove from bookmarks` : t`Bookmark`,
action: onToggleBookmark, icon: "bookmark",
}; action: onToggleBookmark,
}
: null;
if (isPinned) { if (isPinned) {
result.push({ if (onPin) {
title: t`Unpin`, result.push({
icon: "unpin", title: t`Unpin`,
action: onPin, icon: "unpin",
}); action: onPin,
result.push(bookmarkAction); });
}
if (bookmarkAction) {
result.push(bookmarkAction);
}
} else { } else {
result.push(bookmarkAction); if (bookmarkAction) {
result.push({ result.push(bookmarkAction);
title: t`Pin this`, }
icon: "pin", if (onPin) {
action: onPin, result.push({
}); title: t`Pin this`,
icon: "pin",
action: onPin,
});
}
} }
if (isMetabotShown) { if (isMetabotShown) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment