diff options
Diffstat (limited to 'middleware')
| -rw-r--r-- | middleware/src/app/[gameName]/page.tsx | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/middleware/src/app/[gameName]/page.tsx b/middleware/src/app/[gameName]/page.tsx index d4e7b51..10e8b40 100644 --- a/middleware/src/app/[gameName]/page.tsx +++ b/middleware/src/app/[gameName]/page.tsx @@ -85,11 +85,14 @@ export default async function GamePage({ if (postId && mainNewsUrl && !ua.isBot) { const { redirect } = await import("next/navigation"); + if(gameName === "news"){ + redirect(`${mainNewsUrl}/#${postId}`); + } redirect(`${mainNewsUrl}/game/${gameName}#${postId}`); } const redirectUrl = - postId && mainNewsUrl ? `${mainNewsUrl}/game/${gameName}#${postId}` : mainNewsUrl; + postId && mainNewsUrl ? (gameName === "news" ? `${mainNewsUrl}/#${postId}` : `${mainNewsUrl}/game/${gameName}#${postId}`) : mainNewsUrl; return ( <main className="main"> |
