|
@@ -27,8 +27,8 @@ const getGames = async () => {
|
|
};
|
|
};
|
|
|
|
|
|
const Left: React.FC<Props> = ({ actInfo, onChage, onInit }) => {
|
|
const Left: React.FC<Props> = ({ actInfo, onChage, onInit }) => {
|
|
- const [tags, setTags] = React.useState([
|
|
|
|
- { id: 1, text: "Popular", img: "https://bcwin.s3.sa-east-1.amazonaws.com/quente.png" },
|
|
|
|
|
|
+ const [tags, setTags] = React.useState<any>([
|
|
|
|
+ // { id: 1, text: "Popular", img: "https://bcwin.s3.sa-east-1.amazonaws.com/quente.png" },
|
|
]);
|
|
]);
|
|
const { providers, setProviders } = useProviderStore();
|
|
const { providers, setProviders } = useProviderStore();
|
|
const router = useRouter();
|
|
const router = useRouter();
|
|
@@ -46,13 +46,12 @@ const Left: React.FC<Props> = ({ actInfo, onChage, onInit }) => {
|
|
React.useEffect(() => {
|
|
React.useEffect(() => {
|
|
if (actInfo?.id) {
|
|
if (actInfo?.id) {
|
|
let res;
|
|
let res;
|
|
- if (actInfo.type === GameListTypeEnum.TAG) {
|
|
|
|
- res = tags.find((item) => item.id === actInfo.id);
|
|
|
|
|
|
+ if (actInfo.type === GameListTypeEnum.TAG && tags?.length) {
|
|
|
|
+ res = tags.find((item: any) => item.id === actInfo.id);
|
|
}
|
|
}
|
|
- if (actInfo.type === GameListTypeEnum.PROVIDER) {
|
|
|
|
|
|
+ if (actInfo.type === GameListTypeEnum.PROVIDER && providers?.length) {
|
|
res = providers.find((item) => item.id === actInfo.id);
|
|
res = providers.find((item) => item.id === actInfo.id);
|
|
}
|
|
}
|
|
-
|
|
|
|
if (res) {
|
|
if (res) {
|
|
if (typeof onInit === "function") onInit();
|
|
if (typeof onInit === "function") onInit();
|
|
return;
|
|
return;
|
|
@@ -94,7 +93,7 @@ const Left: React.FC<Props> = ({ actInfo, onChage, onInit }) => {
|
|
// if (!providers?.length) return null;
|
|
// if (!providers?.length) return null;
|
|
return (
|
|
return (
|
|
<div className={styles.left}>
|
|
<div className={styles.left}>
|
|
- {tags.map((item) => {
|
|
|
|
|
|
+ {tags.map((item: any) => {
|
|
return (
|
|
return (
|
|
<div
|
|
<div
|
|
key={item.id}
|
|
key={item.id}
|