Fix some potential issues when displaying languages

This commit is contained in:
LASER-Yi 2021-04-20 20:07:02 +08:00
parent 81a207b47f
commit d6d9e93843
2 changed files with 17 additions and 3 deletions

View file

@ -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>
));

View file

@ -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>
));