mirror of
https://github.com/Radarr/Radarr.git
synced 2026-04-23 22:25:14 -04:00
Convert store selectors to Typescript
(cherry picked from commit a57b35a1966266b49d1241474fe3b69523f70474)
This commit is contained in:
@@ -4,6 +4,7 @@ import { useSelector } from 'react-redux';
|
||||
import { icons } from 'Helpers/Props';
|
||||
import createUISettingsSelector from 'Store/Selectors/createUISettingsSelector';
|
||||
import dimensions from 'Styles/Variables/dimensions';
|
||||
import QualityProfile from 'typings/QualityProfile';
|
||||
import { UiSettings } from 'typings/UiSettings';
|
||||
import formatDateTime from 'Utilities/Date/formatDateTime';
|
||||
import getRelativeDate from 'Utilities/Date/getRelativeDate';
|
||||
@@ -33,7 +34,7 @@ interface MovieIndexOverviewInfoProps {
|
||||
showSizeOnDisk: boolean;
|
||||
monitored: boolean;
|
||||
studio?: string;
|
||||
qualityProfile: object;
|
||||
qualityProfile?: QualityProfile;
|
||||
added?: string;
|
||||
path: string;
|
||||
sizeOnDisk?: number;
|
||||
@@ -100,13 +101,10 @@ function getInfoRowProps(
|
||||
};
|
||||
}
|
||||
|
||||
if (name === 'qualityProfileId') {
|
||||
if (name === 'qualityProfileId' && !!props.qualityProfile?.name) {
|
||||
return {
|
||||
title: 'Quality Profile',
|
||||
iconName: icons.PROFILE,
|
||||
// TODO: Type QualityProfile
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore ts(2339)
|
||||
label: props.qualityProfile.name,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -229,7 +229,7 @@ function MovieIndexPoster(props: MovieIndexPosterProps) {
|
||||
</div>
|
||||
) : null}
|
||||
|
||||
{showQualityProfile ? (
|
||||
{showQualityProfile && !!qualityProfile?.name ? (
|
||||
<div className={styles.title} title={translate('QualityProfile')}>
|
||||
{qualityProfile.name}
|
||||
</div>
|
||||
|
||||
@@ -14,7 +14,7 @@ import styles from './MovieIndexPosterInfo.css';
|
||||
interface MovieIndexPosterInfoProps {
|
||||
studio?: string;
|
||||
showQualityProfile: boolean;
|
||||
qualityProfile: QualityProfile;
|
||||
qualityProfile?: QualityProfile;
|
||||
added?: string;
|
||||
year: number;
|
||||
inCinemas?: string;
|
||||
@@ -68,7 +68,11 @@ function MovieIndexPosterInfo(props: MovieIndexPosterInfoProps) {
|
||||
);
|
||||
}
|
||||
|
||||
if (sortKey === 'qualityProfileId' && !showQualityProfile) {
|
||||
if (
|
||||
sortKey === 'qualityProfileId' &&
|
||||
!showQualityProfile &&
|
||||
!!qualityProfile?.name
|
||||
) {
|
||||
return (
|
||||
<div className={styles.info} title={translate('QualityProfile')}>
|
||||
{qualityProfile.name}
|
||||
|
||||
@@ -210,7 +210,7 @@ function MovieIndexRow(props: MovieIndexRowProps) {
|
||||
if (name === 'qualityProfileId') {
|
||||
return (
|
||||
<VirtualTableRowCell key={name} className={styles[name]}>
|
||||
{qualityProfile.name}
|
||||
{qualityProfile?.name ?? ''}
|
||||
</VirtualTableRowCell>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user