From 69d93f9feee1aa5470e9a60a13bab2a2b086c89a Mon Sep 17 00:00:00 2001 From: Hampus Date: Fri, 2 Oct 2026 18:20:01 +0200 Subject: [PATCH] fix(premium): serve the Plutonium page at /channels/@premium (#3132) --- fluxer_app/src/app/Routes.ts | 10 ++++++---- fluxer_app/src/app/router/routes/AppRoutes.tsx | 7 +++++++ .../oauth_authorize_page/state/useAuthorizeFlow.ts | 2 +- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/fluxer_app/src/app/Routes.ts b/fluxer_app/src/app/Routes.ts index ca0456b55..cdb2068f8 100644 --- a/fluxer_app/src/app/Routes.ts +++ b/fluxer_app/src/app/Routes.ts @@ -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; diff --git a/fluxer_app/src/app/router/routes/AppRoutes.tsx b/fluxer_app/src/app/router/routes/AppRoutes.tsx index fff4c6b86..a315e2436 100644 --- a/fluxer_app/src/app/router/routes/AppRoutes.tsx +++ b/fluxer_app/src/app/router/routes/AppRoutes.tsx @@ -226,6 +226,12 @@ const plutoniumRoute = createRoute({ ), }); +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])]), ]), diff --git a/fluxer_app/src/features/auth/components/pages/oauth_authorize_page/state/useAuthorizeFlow.ts b/fluxer_app/src/features/auth/components/pages/oauth_authorize_page/state/useAuthorizeFlow.ts index 3dda6adb2..33feddbd3 100644 --- a/fluxer_app/src/features/auth/components/pages/oauth_authorize_page/state/useAuthorizeFlow.ts +++ b/fluxer_app/src/features/auth/components/pages/oauth_authorize_page/state/useAuthorizeFlow.ts @@ -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;