From 1d977dc5c1eabf51cf1353ac4409f9477fb2e68a Mon Sep 17 00:00:00 2001 From: nklhrstv Date: Tue, 7 Apr 2020 09:53:02 +0300 Subject: [PATCH] trailer href fixed --- src/common/MetaPreview/MetaPreview.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/common/MetaPreview/MetaPreview.js b/src/common/MetaPreview/MetaPreview.js index 6e6c06c4c..5235cea8e 100644 --- a/src/common/MetaPreview/MetaPreview.js +++ b/src/common/MetaPreview/MetaPreview.js @@ -64,10 +64,12 @@ const MetaPreview = ({ className, compact, name, logo, background, runtime, rele []; }, [links]); const trailerHref = React.useMemo(() => { - return typeof trailer === 'object' && trailer !== null ? - deepLinking.withStream({ stream: trailer }).player - : - null; + if (typeof trailer !== 'object' || trailer === null) { + return null; + } + + const deepLinks = deepLinking.withStream({ stream: trailer }); + return deepLinks.player; }, [trailer]); const renderLogoFallback = React.useMemo(() => () => (