Skip to content

🎧 Your Personal Streaming Service

fix(common): Hide Share/Get Info items in disc context menu - #3204 (#3209)

Sunny6709ab3c5e02
diff --git a/ui/src/common/ContextMenus.js b/ui/src/common/ContextMenus.js
index ba41b70b0..2caeb4675 100644
--- a/ui/src/common/ContextMenus.js
+++ b/ui/src/common/ContextMenus.js
@@ -40,6 +40,7 @@ const ContextMenu = ({
color,
className,
songQueryParams,
+ hideShare,
hideInfo,
}) => {
const classes = useStyles({ color })
@@ -80,13 +81,15 @@ const ContextMenu = ({
label: translate('resources.album.actions.addToPlaylist'),
action: (data, ids) => dispatch(openAddToPlaylist({ selectedIds: ids })),
},
- share: {
- enabled: config.enableSharing,
- needData: false,
- label: translate('ra.action.share'),
- action: (record) =>
- dispatch(openShareMenu([record.id], resource, record.name)),
- },
+ ...(!hideShare && {
+ share: {
+ enabled: config.enableSharing,
+ needData: false,
+ label: translate('ra.action.share'),
+ action: (record) =>
+ dispatch(openShareMenu([record.id], resource, record.name)),
+ },
+ }),
download: {
enabled: config.enableDownloads && record.size,
needData: false,
diff --git a/ui/src/common/SongDatagrid.js b/ui/src/common/SongDatagrid.js
index c2ace92a8..0ee30251a 100644
--- a/ui/src/common/SongDatagrid.js
+++ b/ui/src/common/SongDatagrid.js
@@ -136,6 +136,8 @@ const DiscSubtitleRow = forwardRef(
releaseDate={record.releaseDate}
showLove={false}
className={classes.contextMenu}
+ hideShare={true}
+ hideInfo={true}
visible={contextAlwaysVisible}
/>
</TableCell>