Skip to content

A free and open source instant messaging and VoIP chat app built for friends, groups, and communities.

TypeScript fluxerfluxerapp

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

Hampus69d93f9feee1
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({
</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])]),
]),
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;