mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-04-21 15:52:02 +00:00
fix(Video): right click menu crash
This commit is contained in:
parent
9f56557c79
commit
8821eaf4a1
1 changed files with 19 additions and 2 deletions
|
|
@ -68,10 +68,27 @@ const Video = React.forwardRef(({ className, id, title, thumbnail, season, episo
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, [deepLinks]);
|
}, [deepLinks]);
|
||||||
const renderLabel = React.useMemo(() => function renderLabel({ className, id, title, thumbnail, episode, released, upcoming, watched, progress, scheduled, children, ...props }) {
|
const renderLabel = React.useMemo(() => function renderLabel({ className, id, title, thumbnail, episode, released, upcoming, watched, progress, scheduled, children, ref: popupRef, ...props }) {
|
||||||
const blurThumbnail = profile.settings.hideSpoilers && season && episode && !watched;
|
const blurThumbnail = profile.settings.hideSpoilers && season && episode && !watched;
|
||||||
|
const handleRef = React.useCallback((node) => {
|
||||||
|
if (popupRef) {
|
||||||
|
if (typeof popupRef === 'function') {
|
||||||
|
popupRef(node);
|
||||||
|
} else {
|
||||||
|
popupRef.current = node;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (ref) {
|
||||||
|
if (typeof ref === 'function') {
|
||||||
|
ref(node);
|
||||||
|
} else {
|
||||||
|
ref.current = node;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, [popupRef]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Button {...props} className={classnames(className, styles['video-container'])} title={title} ref={ref}>
|
<Button {...props} className={classnames(className, styles['video-container'])} title={title} ref={handleRef}>
|
||||||
{
|
{
|
||||||
typeof thumbnail === 'string' && thumbnail.length > 0 ?
|
typeof thumbnail === 'string' && thumbnail.length > 0 ?
|
||||||
<div className={styles['thumbnail-container']}>
|
<div className={styles['thumbnail-container']}>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue