Merge branch 'development' of github.com:Stremio/stremio-web into streaming-server-middleware

This commit is contained in:
nklhrstv 2020-06-03 16:21:12 +03:00
commit 2bbf3934c9

View file

@ -27,7 +27,8 @@ const ALLOWED_LINK_REDIRECTS = [
const MetaPreview = ({ className, compact, name, logo, background, runtime, releaseInfo, released, description, links, trailer, inLibrary, toggleInLibrary }) => {
const [shareModalOpen, openShareModal, closeShareModal] = useBinaryState(false);
const linksGroups = React.useMemo(() => {
return links
return Array.isArray(links) ?
links
.filter((link) => link && typeof link.category === 'string' && typeof link.url === 'string')
.reduce((linksGroups, { category, name, url }) => {
if (category === CONSTANTS.IMDB_LINK_CATEGORY) {
@ -64,7 +65,9 @@ const MetaPreview = ({ className, compact, name, logo, background, runtime, rele
}
return linksGroups;
}, new Map());
}, new Map())
:
new Map();
}, [links]);
const trailerHref = React.useMemo(() => {
if (typeof trailer !== 'object' || trailer === null) {