From e4a50c33f105b440243885d72a9e96595a525447 Mon Sep 17 00:00:00 2001 From: TheCatLady <52870424+TheCatLady@users.noreply.github.com> Date: Wed, 3 Feb 2021 18:27:06 -0500 Subject: [PATCH] fix(ui): Hide 'Mark 4k as Available' button if 4k not enabled (#833) --- src/components/MovieDetails/index.tsx | 8 ++++++-- src/components/TvDetails/index.tsx | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/components/MovieDetails/index.tsx b/src/components/MovieDetails/index.tsx index 1614c4494..095ccc138 100644 --- a/src/components/MovieDetails/index.tsx +++ b/src/components/MovieDetails/index.tsx @@ -36,6 +36,7 @@ import ConfirmButton from '../Common/ConfirmButton'; import DownloadBlock from '../DownloadBlock'; import ButtonWithDropdown from '../Common/ButtonWithDropdown'; import PageTitle from '../Common/PageTitle'; +import useSettings from '../../hooks/useSettings'; const messages = defineMessages({ releasedate: 'Release Date', @@ -81,6 +82,7 @@ interface MovieDetailsProps { } const MovieDetails: React.FC = ({ movie }) => { + const settings = useSettings(); const { hasPermission } = useUser(); const router = useRouter(); const intl = useIntl(); @@ -174,7 +176,8 @@ const MovieDetails: React.FC = ({ movie }) => { )} {data?.mediaInfo && (data.mediaInfo.status !== MediaStatus.AVAILABLE || - data.mediaInfo.status4k !== MediaStatus.AVAILABLE) && ( + (data.mediaInfo.status4k !== MediaStatus.AVAILABLE && + settings.currentSettings.movie4kEnabled)) && (
{data?.mediaInfo && data?.mediaInfo.status !== MediaStatus.AVAILABLE && ( @@ -201,7 +204,8 @@ const MovieDetails: React.FC = ({ movie }) => {
)} {data?.mediaInfo && - data?.mediaInfo.status4k !== MediaStatus.AVAILABLE && ( + data?.mediaInfo.status4k !== MediaStatus.AVAILABLE && + settings.currentSettings.movie4kEnabled && (