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

161 lines
7 KiB
TypeScript
Raw Normal View History

2026-07-30 10:14:41 +00:00
// Module ID: 10873
// Function ID: 10874
2026-07-20 16:05:17 +00:00
// Name: convertRouteToNavigation
2026-07-29 08:29:29 +00:00
// Dependencies: [676, 4043, 4040, 4041, 4011, 4024, 2]
2026-07-20 16:05:17 +00:00
// Exports: convertRouteToNavigation
2026-07-30 10:14:41 +00:00
// Module 10873 (convertRouteToNavigation)
2026-07-23 10:11:24 +00:00
import { Routes } from "ME";
2026-07-29 08:29:29 +00:00
let result = require("navigationToRootTabHelper").fileFinishedImporting("modules/routing/convertRouteToNavigation.native.tsx");
2026-07-20 16:05:17 +00:00
export const convertRouteToNavigation = function convertRouteToNavigation(pathname) {
let channelId;
let guildId;
let messageId;
2026-07-29 08:29:29 +00:00
let navigationReplace;
let openChannel;
2026-07-20 16:05:17 +00:00
pathname = pathname.pathname;
2026-07-29 08:29:29 +00:00
let obj = require(4041) /* getRootNavigationRef */;
2026-07-20 16:05:17 +00:00
const rootNavigationRef = obj.getRootNavigationRef();
if (null != rootNavigationRef) {
if (rootNavigationRef.isReady()) {
if (pathname.startsWith("/channels/")) {
2026-07-29 08:29:29 +00:00
let tmpResult = tmp(4011);
obj = { path: null };
let obj4 = Routes;
const RouteParam = tmp(4024).RouteParam;
const RouteParam2 = tmp(4024).RouteParam;
2026-07-20 16:05:17 +00:00
const guildIdResult = RouteParam.guildId();
2026-07-29 08:29:29 +00:00
const RouteParam3 = tmp(4024).RouteParam;
const CHANNELResult = Routes.CHANNEL(RouteParam.guildId(), RouteParam2.channelId({ optional: true }));
const RouteParam4 = tmp(4024).RouteParam;
2026-07-20 16:05:17 +00:00
const _HermesInternal = HermesInternal;
2026-07-29 08:29:29 +00:00
obj[0] = "" + CHANNELResult + Routes.VOICE_CHAT_CHANNEL_PARTIAL(RouteParam3.guildId({ name: "voiceGuildId" }), RouteParam4.channelId({ name: "voiceChannelId" }), ":voiceMessageId?");
if (null != tmpResult.matchPath(pathname, obj)) {
2026-07-20 16:05:17 +00:00
return true;
} else {
2026-07-29 08:29:29 +00:00
tmpResult = tmp(4011);
obj = { path: null };
const RouteParam6 = tmp(4024).RouteParam;
const RouteParam7 = tmp(4024).RouteParam;
obj[0] = obj4.CHANNEL(RouteParam6.guildId(), RouteParam7.channelId({ optional: true }), ":messageId?");
const matchPathResult = tmpResult.matchPath(pathname, obj);
2026-07-20 16:05:17 +00:00
if (null != matchPathResult) {
({ channelId, guildId, messageId } = matchPathResult.params);
2026-07-29 08:29:29 +00:00
({ navigationReplace, openChannel } = pathname);
if (tmpResult1.getChatLayout().isChatLockedOpen) {
2026-07-20 16:05:17 +00:00
if (null != channelId) {
if (false === navigationReplace) {
2026-07-29 08:29:29 +00:00
const tmpResult2 = tmp(4040);
const rootNavigationRef1 = tmp(4041).getRootNavigationRef();
2026-07-20 16:05:17 +00:00
let currentRoute;
2026-07-29 08:29:29 +00:00
if (rootNavigationRef1 != null) {
2026-07-20 16:05:17 +00:00
currentRoute = rootNavigationRef1.getCurrentRoute();
}
2026-07-29 08:29:29 +00:00
const coerceGuildsRouteResult = tmpResult2.coerceGuildsRoute(currentRoute);
2026-07-20 16:05:17 +00:00
channelId = undefined;
2026-07-29 08:29:29 +00:00
if (coerceGuildsRouteResult != null) {
2026-07-20 16:05:17 +00:00
const params = coerceGuildsRouteResult.params;
2026-07-29 08:29:29 +00:00
if (params != null) {
2026-07-20 16:05:17 +00:00
channelId = params.channelId;
}
}
if (channelId === channelId) {
2026-07-29 08:29:29 +00:00
const obj1 = { screen: "guilds", guildId: null, channelId: null, resetRoot: null };
obj1[1] = guildId;
obj1[2] = channelId;
obj1[3] = navigationReplace;
tmp(4040).navigateToRootTab(obj1);
const tmpResult4 = tmp(4040);
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
const obj2 = { channelId: null, guildId: null, messageId: null, replaceChannelAndFixRoot: null };
obj2[0] = channelId;
obj2[1] = guildId;
obj2[2] = messageId;
obj2[3] = navigationReplace;
tmp(4040).navigateToChannel(obj2);
const tmpResult5 = tmp(4040);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const tmpResult3 = tmp(4041);
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
const obj3 = { screen: "guilds", guildId: null, channelId: null, resetRoot: null };
obj3[1] = guildId;
obj3[2] = channelId;
obj3[3] = navigationReplace;
tmp(4040).navigateToRootTab(obj3);
const tmpResult6 = tmp(4040);
2026-07-20 16:05:17 +00:00
} else if (null != channelId) {
if (true === navigationReplace) {
2026-07-29 08:29:29 +00:00
if (openChannel) {
obj4 = { channelId: null, guildId: null, messageId: null, replaceChannelAndFixRoot: null, openChannel: true };
obj4[0] = channelId;
obj4[1] = guildId;
obj4[2] = messageId;
obj4[3] = navigationReplace;
tmp(4040).navigateToChannel(obj4);
const tmpResult7 = tmp(4040);
2026-07-20 16:05:17 +00:00
}
}
if (false !== navigationReplace) {
2026-07-29 08:29:29 +00:00
const obj5 = { screen: "guilds", guildId: null, channelId: null, resetRoot: null };
obj5[1] = guildId;
obj5[2] = channelId;
obj5[3] = navigationReplace;
tmp(4040).navigateToRootTab(obj5);
const tmpResult8 = tmp(4040);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (tmp15) {
const obj6 = { channelId: null, guildId: null, messageId: null, replaceChannelAndFixRoot: "Array" };
obj6[0] = channelId;
obj6[1] = guildId;
obj6[2] = messageId;
tmp(4040).navigateToChannel(obj6);
const tmpResult9 = tmp(4040);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
tmp15 = null != channelId && true !== navigationReplace;
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
const obj7 = { screen: "guilds", guildId: null, channelId: null, resetRoot: null };
obj7[1] = guildId;
obj7[2] = channelId;
obj7[3] = navigationReplace;
tmp(4040).navigateToRootTab(obj7);
const tmpResult10 = tmp(4040);
2026-07-20 16:05:17 +00:00
}
return true;
}
const guildIdResult2 = RouteParam6.guildId();
}
2026-07-29 08:29:29 +00:00
const guildIdResult1 = RouteParam3.guildId({ name: "voiceGuildId" });
2026-07-20 16:05:17 +00:00
}
if (pathname.startsWith("/member-verification/")) {
2026-07-29 08:29:29 +00:00
const obj8 = { path: null };
const RouteParam5 = tmp(4024).RouteParam;
obj8[0] = Routes.GUILD_MEMBER_VERIFICATION(RouteParam5.guildId());
const matchPathResult1 = tmp(4011).matchPath(pathname, obj8);
2026-07-20 16:05:17 +00:00
if (null != matchPathResult1) {
2026-07-29 08:29:29 +00:00
const result = tmp(4040).navigateToMemberVerification(matchPathResult1.params.guildId, matchPathResult1.params.inviteCode);
const tmpResult12 = tmp(4040);
2026-07-20 16:05:17 +00:00
}
return true;
} else {
if (!pathname.startsWith(Routes.LOGIN)) {
2026-07-29 08:29:29 +00:00
if (!pathname.startsWith(tmp7.REGISTER)) {
let flag = pathname.startsWith(tmp7.ACCOUNT_STANDING);
if (flag) {
2026-07-30 10:14:41 +00:00
rootNavigationRef.navigate({ name: "account-standing", params: "call" });
2026-07-29 08:29:29 +00:00
flag = true;
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
return flag;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
tmp(4040).resetToAuthRoute();
flag = true;
const tmpResult13 = tmp(4040);
2026-07-20 16:05:17 +00:00
}
}
}
return true;
};