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

159 lines
6.9 KiB
TypeScript
Raw Normal View History

2026-08-25 06:04:03 +00:00
// Module ID: 11057
// Function ID: 11058
2026-07-20 16:05:17 +00:00
// Name: convertRouteToNavigation
2026-08-25 06:04:03 +00:00
// Dependencies: [676, 4237, 4234, 4235, 4207, 4220, 2]
2026-07-20 16:05:17 +00:00
// Exports: convertRouteToNavigation
2026-08-25 06:04:03 +00:00
// Module 11057 (convertRouteToNavigation)
2026-08-24 06:08:38 +00:00
import set from "set" /* 2 */;
import ME from "ME" /* 676 */;
2026-08-25 06:04:03 +00:00
import getRootNavigationRef from "getRootNavigationRef" /* 4235 */;
2026-07-23 10:11:24 +00:00
2026-08-24 06:08:38 +00:00
const Routes = ME.Routes;
let result = set.fileFinishedImporting("modules/routing/convertRouteToNavigation.native.tsx");
2026-07-20 16:05:17 +00:00
export const convertRouteToNavigation = function convertRouteToNavigation(pathname) {
pathname = pathname.pathname;
2026-08-24 06:08:38 +00:00
let obj = getRootNavigationRef;
2026-07-20 16:05:17 +00:00
const rootNavigationRef = obj.getRootNavigationRef();
if (null != rootNavigationRef) {
if (rootNavigationRef.isReady()) {
if (pathname.startsWith("/channels/")) {
2026-08-25 06:04:03 +00:00
let tmpResult = tmp(4207);
2026-07-29 08:29:29 +00:00
obj = { path: null };
let obj4 = Routes;
2026-08-25 06:04:03 +00:00
const RouteParam = tmp(4220).RouteParam;
const RouteParam2 = tmp(4220).RouteParam;
2026-07-20 16:05:17 +00:00
const guildIdResult = RouteParam.guildId();
2026-08-25 06:04:03 +00:00
const RouteParam3 = tmp(4220).RouteParam;
2026-07-29 08:29:29 +00:00
const CHANNELResult = Routes.CHANNEL(RouteParam.guildId(), RouteParam2.channelId({ optional: true }));
2026-08-25 06:04:03 +00:00
const RouteParam4 = tmp(4220).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-08-25 06:04:03 +00:00
tmpResult = tmp(4207);
2026-07-29 08:29:29 +00:00
obj = { path: null };
2026-08-25 06:04:03 +00:00
const RouteParam6 = tmp(4220).RouteParam;
const RouteParam7 = tmp(4220).RouteParam;
2026-07-29 08:29:29 +00:00
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-08-25 06:04:03 +00:00
const tmpResult2 = tmp(4234);
const rootNavigationRef1 = tmp(4235).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-08-24 06:08:38 +00:00
obj1 = { screen: "guilds", guildId: null, channelId: null, resetRoot: null };
2026-07-29 08:29:29 +00:00
obj1[1] = guildId;
obj1[2] = channelId;
obj1[3] = navigationReplace;
2026-08-25 06:04:03 +00:00
tmp(4234).navigateToRootTab(obj1);
const tmpResult4 = tmp(4234);
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;
2026-08-25 06:04:03 +00:00
tmp(4234).navigateToChannel(obj2);
const tmpResult5 = tmp(4234);
2026-07-20 16:05:17 +00:00
}
2026-08-25 06:04:03 +00:00
const tmpResult3 = tmp(4235);
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;
2026-08-25 06:04:03 +00:00
tmp(4234).navigateToRootTab(obj3);
const tmpResult6 = tmp(4234);
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;
2026-08-25 06:04:03 +00:00
tmp(4234).navigateToChannel(obj4);
const tmpResult7 = tmp(4234);
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;
2026-08-25 06:04:03 +00:00
tmp(4234).navigateToRootTab(obj5);
const tmpResult8 = tmp(4234);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (tmp15) {
2026-08-25 06:04:03 +00:00
const obj6 = { channelId: null, guildId: null, messageId: null, replaceChannelAndFixRoot: "a" };
2026-07-29 08:29:29 +00:00
obj6[0] = channelId;
obj6[1] = guildId;
obj6[2] = messageId;
2026-08-25 06:04:03 +00:00
tmp(4234).navigateToChannel(obj6);
const tmpResult9 = tmp(4234);
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;
2026-08-25 06:04:03 +00:00
tmp(4234).navigateToRootTab(obj7);
const tmpResult10 = tmp(4234);
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 };
2026-08-25 06:04:03 +00:00
const RouteParam5 = tmp(4220).RouteParam;
2026-07-29 08:29:29 +00:00
obj8[0] = Routes.GUILD_MEMBER_VERIFICATION(RouteParam5.guildId());
2026-08-25 06:04:03 +00:00
const matchPathResult1 = tmp(4207).matchPath(pathname, obj8);
2026-07-20 16:05:17 +00:00
if (null != matchPathResult1) {
2026-08-25 06:04:03 +00:00
const result = tmp(4234).navigateToMemberVerification(matchPathResult1.params.guildId, matchPathResult1.params.inviteCode);
const tmpResult12 = tmp(4234);
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-08-06 08:05:19 +00:00
rootNavigationRef.navigate("account-standing");
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-08-25 06:04:03 +00:00
tmp(4234).resetToAuthRoute();
2026-07-29 08:29:29 +00:00
flag = true;
2026-08-25 06:04:03 +00:00
const tmpResult13 = tmp(4234);
2026-07-20 16:05:17 +00:00
}
}
}
return true;
};