From b4037442b15eda59e6b7bc1a48988d28e78a30e1 Mon Sep 17 00:00:00 2001 From: LASER-Yi Date: Sun, 9 May 2021 11:42:21 +0800 Subject: [PATCH] Fix an issue that cause subtitles missing in movie page --- frontend/src/Movies/Detail/index.tsx | 6 ++++-- frontend/src/Movies/Detail/table.tsx | 5 +++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/frontend/src/Movies/Detail/index.tsx b/frontend/src/Movies/Detail/index.tsx index 8cc6a9239..593fabf50 100644 --- a/frontend/src/Movies/Detail/index.tsx +++ b/frontend/src/Movies/Detail/index.tsx @@ -11,7 +11,7 @@ import React, { FunctionComponent, useCallback, useState } from "react"; import { Container, Row } from "react-bootstrap"; import { Helmet } from "react-helmet"; import { Redirect, RouteComponentProps, withRouter } from "react-router-dom"; -import { useMovieBy } from "../../@redux/hooks"; +import { useMovieBy, useProfileBy } from "../../@redux/hooks"; import { MoviesApi, ProvidersApi } from "../../apis"; import { ContentHeader, @@ -51,6 +51,8 @@ const MovieDetailView: FunctionComponent = ({ match }) => { const [movie] = useMovieBy(id); const item = movie.data; + const profile = useProfileBy(movie.data?.profileId); + const showModal = useShowModal(); const [valid, setValid] = useState(true); @@ -141,7 +143,7 @@ const MovieDetailView: FunctionComponent = ({ match }) => { -
+
= ({ movie, profile }) => { return item; }); + console.log(movie.subtitles); + console.log(profileItems); + let raw_subtitles = movie.subtitles; if (onlyDesired) { raw_subtitles = intersectionWith( @@ -116,6 +119,8 @@ const Table: FunctionComponent = ({ movie, profile }) => { ); } + console.log(raw_subtitles); + return [...raw_subtitles, ...missing]; }, [movie.missing_subtitles, movie.subtitles, onlyDesired, profileItems]);