diff options
| author | Pinapelz <yukais@pinapelz.com> | 2025-07-01 13:36:32 -0700 |
|---|---|---|
| committer | Pinapelz <yukais@pinapelz.com> | 2025-07-01 13:36:32 -0700 |
| commit | 6243adb477ca80359c50578295999e7956d3fe57 (patch) | |
| tree | be9f4f78d918f3a8b2e9f23a4e1719f9707b5094 /middleware | |
| parent | 48636e02f3d7a4182d73054a1167a23af1ca9cac (diff) | |
fix: redirection url path parameter for main feed
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"> |
