Files
discord-decomp/modules/guild_scheduled_events/StartEventPlatformUtils.native.tsx
T
2026-11-01 12:12:55 +02:00

66 lines
2.4 KiB
TypeScript

// Metro module 8338 (f8339).
import ChannelStore from "../../stores/ChannelStore";
import RTCConnectionStore from "../../stores/RTCConnectionStore";
import SelectedGuildStore from "../../stores/SelectedGuildStore";
import { GuildScheduledEventEntityTypes } from "./GuildScheduledEventsConstants";
import { Routes } from "../../Constants";
import Module38 from "../../_bundle/Module38";
import { connectToStage, navigateToStage } from "../stage_channels/StageChannelModalActionCreators";
import { audienceAckRequestToSpeak } from "../stage_channels/StageChannelActionCreators";
import SelectedChannelActionCreators from "../../actions/SelectedChannelActionCreators";
import { transitionTo } from "../routing/router_utils";
export async function navigateToEvent(c26192_0, c26192_1) {
let c26192_3;
let c29947_0, c29947_1;
L27: {
c26192_3 = void 0;
c29947_0 = c26192_1;
c29947_1 = void 0;
const { entity_type, guild_id } = c26192_0;
if (GuildScheduledEventEntityTypes.STAGE_INSTANCE === entity_type) {
const channelId = RTCConnectionStore.getChannelId();
const channel = ChannelStore.getChannel(c26192_0.channel_id);
c29947_1 = channel;
Module38(channel != null, "could not find channel");
if (channelId !== channel.id) {
await connectToStage(channel, true);
const r166 = c29947_0;
if (r166 != null) {
r166();
}
await navigateToStage(c29947_1, null);
} else {
const r100 = c29947_0;
if (r100 != null) {
r100();
}
await navigateToStage(c29947_1, null);
}
await audienceAckRequestToSpeak(c29947_1, false);
break L27;
}
if (GuildScheduledEventEntityTypes.VOICE === entity_type) {
const channelId2 = RTCConnectionStore.getChannelId();
const channel2 = ChannelStore.getChannel(c26192_0.channel_id);
Module38(channel2 != null, "could not find channel");
if (channelId2 !== channel2.id) {
SelectedChannelActionCreators.selectVoiceChannel(channel2.id);
}
if (c26192_1 != null) {
c26192_1();
}
} else if (GuildScheduledEventEntityTypes.EXTERNAL === entity_type) {
if (SelectedGuildStore.getGuildId() !== guild_id) {
transitionTo(Routes.CHANNEL(guild_id));
}
if (c26192_1 != null) {
c26192_1();
}
}
return void 0;
}
}
export function postStartActions() {
return Promise.resolve();
}