decord/alpha/source/modules/routing/transitionToChannel.tsx

111 lines
5 KiB
TypeScript
Raw Normal View History

// Module ID: 4856
// Function ID: 4857
2026-07-20 16:05:17 +00:00
// Name: transitionToChannel
// Dependencies: [2044, 1074, 4857, 4858, 1101, 5046, 38, 2]
2026-07-29 08:29:29 +00:00
// Exports: transitionToChannel, transitionToMessage, transitionToStaticChannelRoute, transitionToThread, transitionToThreadMessage, tryTransitionToThreadMessage
2026-07-20 16:05:17 +00:00
// Module 4856 (transitionToChannel)
2026-08-24 06:08:38 +00:00
import _modDef38 from "module_38" /* 38 */;
import router_utils from "router_utils" /* 1101 */;
import useGuildIdForChannelRoute from "useGuildIdForChannelRoute" /* 4857 */;
import ChannelActionCreatorsDefault from "ChannelActionCreators" /* 4858 */;
import ChannelStore from "ChannelStore" /* 2044 */;
2026-07-23 10:11:24 +00:00
require = fn;
const Routes = fn(1074).Routes;
const size = fn(2);
const result = size.fileFinishedImporting("modules/routing/transitionToChannel.tsx");
2026-07-29 08:29:29 +00:00
export const transitionToChannel = function transitionToChannel(id, openTextInVoiceIfVoiceChannel) {
const channel = ChannelStore.getChannel(id);
2026-07-20 16:05:17 +00:00
if (null != channel) {
2026-08-24 06:08:38 +00:00
const guildIdForGenericRedirect = useGuildIdForChannelRoute.getGuildIdForGenericRedirect(channel);
2026-07-29 08:29:29 +00:00
const tmp7 = importDefault;
ChannelActionCreatorsDefault.preload(channel.guild_id, channel.id);
2026-07-20 16:05:17 +00:00
const obj = { openChannel: true };
const obj5 = router_utils;
2026-07-20 16:05:17 +00:00
const merged = Object.assign(openTextInVoiceIfVoiceChannel);
obj5.transitionTo(Routes.CHANNEL(guildIdForGenericRedirect, channel.id), obj);
2026-07-29 08:29:29 +00:00
let prop;
if (openTextInVoiceIfVoiceChannel != null) {
prop = openTextInVoiceIfVoiceChannel.openTextInVoiceIfVoiceChannel;
}
if (prop) {
prop = channel.isGuildVocal();
}
if (prop) {
tmp7(5046).updateChatOpen(channel.id, true);
const tmp7Result = tmp7(5046);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const CHANNELResult = Routes.CHANNEL(guildIdForGenericRedirect, channel.id);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
};
2026-07-20 16:05:17 +00:00
export const transitionToThread = function transitionToThread(channel, arg1) {
2026-08-24 06:08:38 +00:00
_modDef38(null != channel.parent_id, "Thread must have a parent ID.");
const guildIdForGenericRedirect = useGuildIdForChannelRoute.getGuildIdForGenericRedirect(channel);
const obj2 = router_utils;
const obj3 = { openChannel: true };
2026-07-20 16:05:17 +00:00
const merged = Object.assign(arg1);
obj2.transitionTo(Routes.CHANNEL(guildIdForGenericRedirect, channel.id), obj3);
2026-07-20 16:05:17 +00:00
};
2026-07-29 08:29:29 +00:00
export const transitionToThreadMessage = function transitionToThreadMessage(channel, id, arg2) {
2026-08-24 06:08:38 +00:00
_modDef38(null != channel.parent_id, "Thread must have a parent ID.");
const guildIdForGenericRedirect = useGuildIdForChannelRoute.getGuildIdForGenericRedirect(channel);
const obj2 = router_utils;
const obj3 = { openChannel: true };
2026-07-29 08:29:29 +00:00
const merged = Object.assign(arg2);
obj2.transitionTo(Routes.CHANNEL(guildIdForGenericRedirect, channel.id, id), obj3);
2026-07-29 08:29:29 +00:00
};
export const tryTransitionToThreadMessage = function tryTransitionToThreadMessage(parentChannelId, threadId, messageId, arg3) {
const channel = ChannelStore.getChannel(threadId);
2026-07-20 16:05:17 +00:00
if (null != channel) {
2026-08-24 06:08:38 +00:00
_modDef38(null != channel.parent_id, "Thread must have a parent ID.");
const guildIdForGenericRedirect = useGuildIdForChannelRoute.getGuildIdForGenericRedirect(channel);
const obj2 = { openChannel: true };
const obj4 = router_utils;
2026-07-29 08:29:29 +00:00
const merged = Object.assign(arg3);
obj4.transitionTo(Routes.CHANNEL(guildIdForGenericRedirect, channel.id, messageId), obj2);
2026-07-29 08:29:29 +00:00
const CHANNELResult = Routes.CHANNEL(guildIdForGenericRedirect, channel.id, messageId);
2026-07-20 16:05:17 +00:00
} else {
const channel1 = ChannelStore.getChannel(parentChannelId);
2026-07-29 08:29:29 +00:00
if (null != channel1) {
2026-08-24 06:08:38 +00:00
const guildIdForGenericRedirect1 = useGuildIdForChannelRoute.getGuildIdForGenericRedirect(channel1);
2026-07-29 08:29:29 +00:00
const tmp20 = importDefault;
ChannelActionCreatorsDefault.preload(channel1.guild_id, channel1.id);
const obj5 = { openChannel: true };
const obj9 = router_utils;
2026-07-29 08:29:29 +00:00
const merged1 = Object.assign(arg3);
obj9.transitionTo(Routes.CHANNEL(guildIdForGenericRedirect1, channel1.id), obj5);
2026-07-29 08:29:29 +00:00
let prop;
if (arg3 != null) {
prop = arg3.openTextInVoiceIfVoiceChannel;
}
if (prop) {
prop = channel1.isGuildVocal();
}
if (prop) {
tmp20(5046).updateChatOpen(channel1.id, true);
const tmp20Result = tmp20(5046);
2026-07-29 08:29:29 +00:00
}
const CHANNELResult1 = Routes.CHANNEL(guildIdForGenericRedirect1, channel1.id);
}
2026-07-20 16:05:17 +00:00
}
};
export const transitionToMessage = function transitionToMessage(channelId, messageId, arg2) {
const channel = ChannelStore.getChannel(channelId);
2026-07-20 16:05:17 +00:00
if (null != channel) {
const guildIdForGenericRedirect = useGuildIdForChannelRoute.getGuildIdForGenericRedirect(channel);
const obj3 = { openChannel: true };
const obj2 = router_utils;
2026-07-20 16:05:17 +00:00
const merged = Object.assign(arg2);
obj2.transitionTo(Routes.CHANNEL(guildIdForGenericRedirect, channel.id, messageId), obj3);
const CHANNELResult = Routes.CHANNEL(guildIdForGenericRedirect, channel.id, messageId);
2026-07-20 16:05:17 +00:00
}
};
export const transitionToStaticChannelRoute = function transitionToStaticChannelRoute(guildId, GUILD_HOME, arg2) {
const obj = router_utils;
const obj2 = { openChannel: true };
2026-07-20 16:05:17 +00:00
const merged = Object.assign(arg2);
obj.transitionTo(Routes.CHANNEL(guildId, GUILD_HOME), obj2);
2026-07-20 16:05:17 +00:00
};