mirror of
https://github.com/navidrome/navidrome.git
synced 2026-05-03 06:51:16 +00:00
Don't break if it tries to render ContextMenu without data. Fix #776
This commit is contained in:
parent
fbe6ecea95
commit
48847ae479
@ -166,7 +166,8 @@ const ContextMenu = ({
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
export const AlbumContextMenu = (props) => (
|
export const AlbumContextMenu = (props) =>
|
||||||
|
props.record ? (
|
||||||
<ContextMenu
|
<ContextMenu
|
||||||
{...props}
|
{...props}
|
||||||
resource={'album'}
|
resource={'album'}
|
||||||
@ -176,7 +177,7 @@ export const AlbumContextMenu = (props) => (
|
|||||||
filter: { album_id: props.record.id, disc_number: props.discNumber },
|
filter: { album_id: props.record.id, disc_number: props.discNumber },
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
)
|
) : null
|
||||||
|
|
||||||
AlbumContextMenu.propTypes = {
|
AlbumContextMenu.propTypes = {
|
||||||
record: PropTypes.object,
|
record: PropTypes.object,
|
||||||
@ -190,7 +191,8 @@ AlbumContextMenu.defaultProps = {
|
|||||||
addLabel: true,
|
addLabel: true,
|
||||||
}
|
}
|
||||||
|
|
||||||
export const ArtistContextMenu = (props) => (
|
export const ArtistContextMenu = (props) =>
|
||||||
|
props.record ? (
|
||||||
<ContextMenu
|
<ContextMenu
|
||||||
{...props}
|
{...props}
|
||||||
resource={'artist'}
|
resource={'artist'}
|
||||||
@ -200,7 +202,7 @@ export const ArtistContextMenu = (props) => (
|
|||||||
filter: { album_artist_id: props.record.id },
|
filter: { album_artist_id: props.record.id },
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
)
|
) : null
|
||||||
|
|
||||||
ArtistContextMenu.propTypes = {
|
ArtistContextMenu.propTypes = {
|
||||||
record: PropTypes.object,
|
record: PropTypes.object,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user