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