fix(ui): correct season pluralization in RequestItem (#2307)
Fixes incorrect "Seasons" label when only one season is requested. fix #2263
This commit is contained in:
@@ -5,7 +5,6 @@ import ConfirmButton from '@app/components/Common/ConfirmButton';
|
|||||||
import RequestModal from '@app/components/RequestModal';
|
import RequestModal from '@app/components/RequestModal';
|
||||||
import StatusBadge from '@app/components/StatusBadge';
|
import StatusBadge from '@app/components/StatusBadge';
|
||||||
import useDeepLinks from '@app/hooks/useDeepLinks';
|
import useDeepLinks from '@app/hooks/useDeepLinks';
|
||||||
import useSettings from '@app/hooks/useSettings';
|
|
||||||
import { Permission, useUser } from '@app/hooks/useUser';
|
import { Permission, useUser } from '@app/hooks/useUser';
|
||||||
import globalMessages from '@app/i18n/globalMessages';
|
import globalMessages from '@app/i18n/globalMessages';
|
||||||
import defineMessages from '@app/utils/defineMessages';
|
import defineMessages from '@app/utils/defineMessages';
|
||||||
@@ -295,7 +294,6 @@ interface RequestItemProps {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const RequestItem = ({ request, revalidateList }: RequestItemProps) => {
|
const RequestItem = ({ request, revalidateList }: RequestItemProps) => {
|
||||||
const settings = useSettings();
|
|
||||||
const { ref, inView } = useInView({
|
const { ref, inView } = useInView({
|
||||||
triggerOnce: true,
|
triggerOnce: true,
|
||||||
});
|
});
|
||||||
@@ -470,14 +468,7 @@ const RequestItem = ({ request, revalidateList }: RequestItemProps) => {
|
|||||||
<div className="card-field">
|
<div className="card-field">
|
||||||
<span className="card-field-name">
|
<span className="card-field-name">
|
||||||
{intl.formatMessage(messages.seasons, {
|
{intl.formatMessage(messages.seasons, {
|
||||||
seasonCount:
|
seasonCount: request.seasons.length,
|
||||||
(settings.currentSettings.enableSpecialEpisodes
|
|
||||||
? title.seasons.length
|
|
||||||
: title.seasons.filter(
|
|
||||||
(season) => season.seasonNumber !== 0
|
|
||||||
).length) === request.seasons.length
|
|
||||||
? 0
|
|
||||||
: request.seasons.length,
|
|
||||||
})}
|
})}
|
||||||
</span>
|
</span>
|
||||||
<div className="hide-scrollbar flex flex-nowrap overflow-x-scroll">
|
<div className="hide-scrollbar flex flex-nowrap overflow-x-scroll">
|
||||||
|
|||||||
Reference in New Issue
Block a user