fix(premium): serve the Plutonium page at /channels/@premium (#3132)

This commit is contained in:
Hampus
2026-10-02 18:20:01 +02:00
committed by GitHub
parent 00620715da
commit 69d93f9fee
3 changed files with 14 additions and 5 deletions
+6 -4
View File
@@ -34,7 +34,8 @@ export const Routes = {
CONNECTION_CALLBACK: '/connection-callback',
USER_PROFILE: '/users/:userId',
THEME_STUDIO: '/theme-studio',
PLUTONIUM: '/plutonium',
PLUTONIUM: '/channels/@premium',
LEGACY_PLUTONIUM: '/plutonium',
terms: () => marketingUrl('terms'),
privacy: () => marketingUrl('privacy'),
guidelines: () => marketingUrl('guidelines'),
@@ -70,11 +71,12 @@ export const Routes = {
isDMRoute: (pathname: string) => pathname.startsWith('/channels/@me'),
isFavoritesRoute: (pathname: string) => pathname.startsWith('/channels/@favorites'),
isDiscoverRoute: (pathname: string) => pathname.startsWith('/channels/@discover'),
isPlutoniumRoute: (pathname: string) => pathname === '/plutonium',
isChannelRoute: (pathname: string) => pathname.startsWith('/channels/'),
isPlutoniumRoute: (pathname: string) => pathname === '/channels/@premium',
isChannelRoute: (pathname: string) => pathname.startsWith('/channels/') && !pathname.startsWith('/channels/@premium'),
isGuildChannelRoute: (pathname: string) =>
pathname.startsWith('/channels/') &&
!pathname.startsWith('/channels/@me') &&
!pathname.startsWith('/channels/@favorites') &&
!pathname.startsWith('/channels/@discover'),
!pathname.startsWith('/channels/@discover') &&
!pathname.startsWith('/channels/@premium'),
} as const;
@@ -226,6 +226,12 @@ const plutoniumRoute = createRoute({
</DMLayout>
),
});
const legacyPlutoniumRoute = createRoute({
getParentRoute: () => guildsLayoutRoute,
id: 'legacyPlutonium',
path: Routes.LEGACY_PLUTONIUM,
onEnter: () => new Redirect(Routes.PLUTONIUM),
});
const userProfileRoute = createRoute({
getParentRoute: () => appLayoutRoute,
id: 'userProfile',
@@ -335,6 +341,7 @@ export const appRouteTree = appLayoutRoute.addChildren([
meRoute,
discoverRoute,
plutoniumRoute,
legacyPlutoniumRoute,
favoritesRoute.addChildren([favoritesChannelRoute]),
channelsRoute.addChildren([membersRoute, channelRoute.addChildren([messageRoute])]),
]),
@@ -145,7 +145,7 @@ function getCurrentInviteDestinationKey(): string | null {
if (guildId === '@me') {
return channelId ? createBotInviteDestinationKey('group_dm', channelId) : null;
}
if (guildId !== '@favorites' && guildId !== '@discover') {
if (guildId !== '@favorites' && guildId !== '@discover' && guildId !== '@premium') {
return createBotInviteDestinationKey('guild', guildId);
}
return null;