Skip to content

Commit 3fe281a

Browse files
author
Shannon Anahata
committed
fixing bugs
1 parent 5affddc commit 3fe281a

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

app/platform-redirect/page.tsx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,10 @@ export default async function Page(props: {
5757
...pathname.split('/').filter(Boolean),
5858
]);
5959
if (node) {
60-
// Update the platform URL to point to the guide
61-
platform_.url = guide.url;
60+
// Create a copy of the platform with the guide URL to avoid mutating the original
61+
const platformCopy = {...platform_, url: guide.url};
62+
// Update the platform reference to use the copy
63+
Object.assign(platform_, platformCopy);
6264
break;
6365
}
6466
}
@@ -77,9 +79,8 @@ export default async function Page(props: {
7779
const expandedPlatformList = [...platformList];
7880

7981
// Find JavaScript platform and add its supported frameworks
80-
// Check both the filtered platformList and all platforms to find JavaScript
81-
const javascriptPlatform = platformList.find(p => p.key === 'javascript') ||
82-
extractPlatforms(rootNode).find(p => p.key === 'javascript');
82+
// Only use JavaScript platform if it's already in the filtered list (has relevant content)
83+
const javascriptPlatform = platformList.find(p => p.key === 'javascript');
8384

8485
if (javascriptPlatform && (
8586
pathname.startsWith('/session-replay/') ||
@@ -101,7 +102,7 @@ export default async function Page(props: {
101102
const otherPlatforms = expandedPlatformList.filter(p => p.key !== 'javascript');
102103

103104
// Add supported JavaScript frameworks as separate entries
104-
const jsFrameworks = [];
105+
const jsFrameworks: typeof platformList = [];
105106
javascriptPlatform.guides?.forEach(guide => {
106107
const guideKey = `javascript.${guide.name}`;
107108
if (!notSupported.includes(guideKey)) {

0 commit comments

Comments
 (0)