Fix some potential issues when displaying languages

pull/1386/head
LASER-Yi 3 years ago
parent 81a207b47f
commit d6d9e93843

@ -16,6 +16,7 @@ import { useReduxAction } from "../@redux/hooks/base";
import { MoviesApi } from "../apis";
import { ActionBadge, TextPopover } from "../components";
import BaseItemView from "../generic/BaseItemView";
import { BuildKey } from "../utilites";
interface Props {}
@ -73,7 +74,11 @@ const MovieView: FunctionComponent<Props> = () => {
accessor: "audio_language",
Cell: (row) => {
return row.value.map((v) => (
<Badge variant="secondary" className="mr-2" key={v.code2}>
<Badge
variant="secondary"
className="mr-2"
key={BuildKey(v.code2, v.code2, v.hi)}
>
{v.name}
</Badge>
));
@ -99,7 +104,11 @@ const MovieView: FunctionComponent<Props> = () => {
Cell: (row) => {
const missing = row.value;
return missing.map((v) => (
<Badge className="mx-2" variant="warning" key={v.code2}>
<Badge
className="mx-2"
variant="warning"
key={BuildKey(v.code2, v.hi, v.forced)}
>
{v.code2}
</Badge>
));

@ -14,6 +14,7 @@ import { useReduxAction } from "../@redux/hooks/base";
import { SeriesApi } from "../apis";
import { ActionBadge } from "../components";
import BaseItemView from "../generic/BaseItemView";
import { BuildKey } from "../utilites";
interface Props {}
@ -59,7 +60,11 @@ const SeriesView: FunctionComponent<Props> = () => {
accessor: "audio_language",
Cell: (row) => {
return row.value.map((v) => (
<Badge variant="secondary" className="mr-2" key={v.code2}>
<Badge
variant="secondary"
className="mr-2"
key={BuildKey(v.code2, v.forced, v.hi)}
>
{v.name}
</Badge>
));

Loading…
Cancel
Save