diff --git a/frontend/src/metabase/components/EntityItem/EntityItem.jsx b/frontend/src/metabase/components/EntityItem/EntityItem.jsx index 1e9b471b32f236b3cb70e8e5bf05c3a2ab9774fe..ffbc403c45b5374bc2e4f83ea365ac1c7fe3f9d2 100644 --- a/frontend/src/metabase/components/EntityItem/EntityItem.jsx +++ b/frontend/src/metabase/components/EntityItem/EntityItem.jsx @@ -106,26 +106,36 @@ function EntityItemMenu({ const actions = useMemo(() => { const result = []; - const bookmarkAction = { - title: isBookmarked ? t`Remove from bookmarks` : t`Bookmark`, - icon: "bookmark", - action: onToggleBookmark, - }; + const bookmarkAction = onToggleBookmark + ? { + title: isBookmarked ? t`Remove from bookmarks` : t`Bookmark`, + icon: "bookmark", + action: onToggleBookmark, + } + : null; if (isPinned) { - result.push({ - title: t`Unpin`, - icon: "unpin", - action: onPin, - }); - result.push(bookmarkAction); + if (onPin) { + result.push({ + title: t`Unpin`, + icon: "unpin", + action: onPin, + }); + } + if (bookmarkAction) { + result.push(bookmarkAction); + } } else { - result.push(bookmarkAction); - result.push({ - title: t`Pin this`, - icon: "pin", - action: onPin, - }); + if (bookmarkAction) { + result.push(bookmarkAction); + } + if (onPin) { + result.push({ + title: t`Pin this`, + icon: "pin", + action: onPin, + }); + } } if (isMetabotShown) {