decord/alpha/source/modules/routing/convertRouteToNavigation.native.tsx

148 lines
6.5 KiB
TypeScript
Raw Permalink Normal View History

2026-10-10 08:08:14 +00:00
// Module ID: 11202
// Function ID: 11203
2026-07-20 16:05:17 +00:00
// Name: convertRouteToNavigation
2026-10-13 12:43:34 +00:00
// Dependencies: [1085, 11203, 4979, 4976, 4977, 4944, 4957, 2]
2026-07-20 16:05:17 +00:00
// Exports: convertRouteToNavigation
2026-10-10 08:08:14 +00:00
// Module 11202 (convertRouteToNavigation)
2026-10-03 08:58:59 +00:00
import Constants from "Constants" /* 1085 */;
2026-10-10 08:08:14 +00:00
import matchPathCompat from "matchPathCompat" /* 4944 */;
import NavigationRouteUtils from "NavigationRouteUtils" /* 4976 */;
import RootNavigationRef from "RootNavigationRef" /* 4977 */;
import useChatLayout from "useChatLayout" /* 4979 */;
2026-10-13 12:43:34 +00:00
import handleConjureRouteDefault from "handleConjureRoute" /* 11203 */;
import size from "module_2" /* 2 */;
2026-07-23 10:11:24 +00:00
const Routes = Constants.Routes;
const result = size.fileFinishedImporting("modules/routing/convertRouteToNavigation.native.tsx");
2026-07-20 16:05:17 +00:00
export const convertRouteToNavigation = function convertRouteToNavigation(pathname) {
2026-10-03 08:58:59 +00:00
let CHANNEL2;
let CHANNELResult;
let RouteParam4;
let RouteParam6;
let VOICE_CHAT_CHANNEL_PARTIAL;
let channelId;
let guildId;
let guildIdResult1;
let guildIdResult2;
let messageId;
let navigationReplace;
let openChannel;
2026-07-20 16:05:17 +00:00
pathname = pathname.pathname;
2026-10-03 08:58:59 +00:00
const obj = RootNavigationRef;
const rootNavigationRef = obj.getRootNavigationRef();
2026-07-20 16:05:17 +00:00
if (null != rootNavigationRef) {
if (rootNavigationRef.isReady()) {
if (pathname.startsWith("/channels/")) {
2026-10-03 08:58:59 +00:00
const obj2 = { path: "" + CHANNELResult + VOICE_CHAT_CHANNEL_PARTIAL(guildIdResult1, RouteParam4.channelId({ name: "voiceChannelId" }), ":voiceMessageId?") };
const matchPath = matchPathCompat.matchPath;
const CHANNEL = Routes.CHANNEL;
matchPathCompat;
2026-10-10 08:08:14 +00:00
const RouteParam = tmp(4957).RouteParam;
2026-07-20 16:05:17 +00:00
const guildIdResult = RouteParam.guildId();
2026-10-10 08:08:14 +00:00
const RouteParam2 = tmp(4957).RouteParam;
2026-10-03 08:58:59 +00:00
VOICE_CHAT_CHANNEL_PARTIAL = Routes.VOICE_CHAT_CHANNEL_PARTIAL;
CHANNELResult = CHANNEL(guildIdResult, RouteParam2.channelId({ optional: true }));
2026-10-10 08:08:14 +00:00
const RouteParam3 = tmp(4957).RouteParam;
2026-10-03 08:58:59 +00:00
guildIdResult1 = RouteParam3.guildId({ name: "voiceGuildId" });
2026-10-10 08:08:14 +00:00
RouteParam4 = tmp(4957).RouteParam;
2026-07-20 16:05:17 +00:00
const _HermesInternal = HermesInternal;
2026-10-03 08:58:59 +00:00
const tmp4 = Routes;
if (null != matchPath(pathname, obj2)) {
2026-07-20 16:05:17 +00:00
return true;
} else {
2026-10-03 08:58:59 +00:00
const obj3 = { path: CHANNEL2(guildIdResult2, RouteParam6.channelId({ optional: true }), ":messageId?") };
const matchPath2 = matchPathCompat.matchPath;
CHANNEL2 = tmp4.CHANNEL;
matchPathCompat;
2026-10-10 08:08:14 +00:00
const RouteParam5 = tmp(4957).RouteParam;
2026-10-03 08:58:59 +00:00
guildIdResult2 = RouteParam5.guildId();
2026-10-10 08:08:14 +00:00
RouteParam6 = tmp(4957).RouteParam;
2026-10-03 08:58:59 +00:00
const matchPath2Result = matchPath2(pathname, obj3);
if (null != matchPath2Result) {
({ channelId, guildId, messageId } = matchPath2Result.params);
2026-07-29 08:29:29 +00:00
({ navigationReplace, openChannel } = pathname);
2026-10-13 12:43:34 +00:00
if (!handleConjureRouteDefault(guildId, channelId, navigationReplace, openChannel)) {
const tmpResult14 = useChatLayout;
if (tmpResult14.getChatLayout().isChatLockedOpen) {
if (null != channelId) {
if (false === navigationReplace) {
const coerceGuildsRoute = NavigationRouteUtils.coerceGuildsRoute;
NavigationRouteUtils;
const tmpResult16 = RootNavigationRef;
const rootNavigationRef1 = tmpResult16.getRootNavigationRef();
let currentRoute;
if (rootNavigationRef1 != null) {
currentRoute = rootNavigationRef1.getCurrentRoute();
}
const coerceGuildsRouteResult = coerceGuildsRoute(currentRoute);
let channelId1;
if (coerceGuildsRouteResult != null) {
const params = coerceGuildsRouteResult.params;
if (params != null) {
channelId1 = params.channelId;
}
}
if (channelId1 === channelId) {
const obj4 = { screen: "guilds", guildId, channelId, resetRoot: navigationReplace };
const tmpResult17 = NavigationRouteUtils;
tmpResult17.navigateToRootTab(obj4);
} else {
const obj5 = { channelId, guildId, messageId, replaceChannelAndFixRoot: navigationReplace };
const tmpResult18 = NavigationRouteUtils;
tmpResult18.navigateToChannel(obj5);
2026-07-20 16:05:17 +00:00
}
}
2026-10-13 12:43:34 +00:00
}
const obj6 = { screen: "guilds", guildId, channelId, resetRoot: navigationReplace };
const tmpResult19 = NavigationRouteUtils;
tmpResult19.navigateToRootTab(obj6);
} else if (null != channelId) {
if (true === navigationReplace) {
if (openChannel) {
const obj7 = { channelId, guildId, messageId, replaceChannelAndFixRoot: navigationReplace, openChannel: true };
const tmpResult20 = NavigationRouteUtils;
tmpResult20.navigateToChannel(obj7);
2026-07-20 16:05:17 +00:00
}
}
2026-10-13 12:43:34 +00:00
if (false !== navigationReplace) {
const obj8 = { screen: "guilds", guildId, channelId, resetRoot: navigationReplace };
const tmpResult21 = NavigationRouteUtils;
tmpResult21.navigateToRootTab(obj8);
2026-07-20 16:05:17 +00:00
}
2026-10-13 12:43:34 +00:00
const tmp19 = null != channelId && true !== navigationReplace;
if (tmp19) {
const obj9 = { channelId, guildId, messageId, replaceChannelAndFixRoot: "a" };
const tmpResult22 = NavigationRouteUtils;
tmpResult22.navigateToChannel(obj9);
}
} else {
const obj10 = { screen: "guilds", guildId, channelId, resetRoot: navigationReplace };
const tmpResult23 = NavigationRouteUtils;
tmpResult23.navigateToRootTab(obj10);
2026-07-20 16:05:17 +00:00
}
}
return true;
}
}
}
if (!pathname.startsWith(Routes.LOGIN)) {
2026-10-03 08:58:59 +00:00
let flag;
if (!pathname.startsWith(Routes.REGISTER)) {
flag = pathname.startsWith(tmp9.ACCOUNT_STANDING);
if (flag) {
rootNavigationRef.navigate("account-standing");
flag = true;
2026-07-20 16:05:17 +00:00
}
}
return flag;
2026-07-20 16:05:17 +00:00
}
2026-10-03 08:58:59 +00:00
const tmpResult24 = NavigationRouteUtils;
tmpResult24.resetToAuthRoute();
flag = true;
2026-07-20 16:05:17 +00:00
}
}
return true;
};