Before 7 месяцев назад
Родитель
Сommit
0d37328a64
1 измененных файлов с 4 добавлено и 1 удалено
  1. 4 1
      src/components/Card/Card.tsx

+ 4 - 1
src/components/Card/Card.tsx

@@ -56,7 +56,10 @@ const Card: FC<PropsWithChildren<CardProps>> = (props) => {
                 if (res.data && res.data.game_url) {
                     const url = `${res.data?.game_url}&brand=${brandRef.current}&return_url=${process.env.NEXT_PUBLIC_SHARE_URL}`;
                     const protocol = new URL(url).protocol;
-                    if (whiteUrls.indexOf(window.location.hostname) || protocol === "https:") {
+                    if (
+                        whiteUrls.indexOf(window.location.hostname) !== -1 ||
+                        protocol === "https:"
+                    ) {
                         router.push(`/game?${url}`);
                     } else {
                         window.open(url);