72 lines
2.3 KiB
TypeScript
72 lines
2.3 KiB
TypeScript
// Metro module 8658 (f8659).
|
|
import GuildStore from "../../stores/GuildStore";
|
|
import { GuildFeatures, JoinGuildSources, Routes } from "../../Constants";
|
|
import Module38 from "../../_bundle/Module38";
|
|
import { startLurking } from "../../utils/GuildDiscoveryUtils";
|
|
import InstantInviteActionCreators from "../../actions/InstantInviteActionCreators";
|
|
import { transitionTo } from "../routing/router_utils";
|
|
export default async function navigateToGameAnnouncement(c26257_0) {
|
|
let c26257_2;
|
|
let c29961_0, c29961_1, c29961_2, c29961_3, c29961_4, c29961_5, c29961_6, c29961_7;
|
|
L28: {
|
|
L27: {
|
|
c26257_2 = void 0;
|
|
c29961_0 = void 0;
|
|
c29961_1 = void 0;
|
|
c29961_2 = void 0;
|
|
c29961_3 = void 0;
|
|
c29961_4 = void 0;
|
|
c29961_0 = c26257_0.invite;
|
|
c29961_1 = c26257_0.guildId;
|
|
c29961_2 = c26257_0.channelId;
|
|
c29961_3 = c26257_0.messageId;
|
|
c29961_4 = c26257_0.analyticsLocationStack;
|
|
c29961_5 = void 0;
|
|
c29961_6 = void 0;
|
|
c29961_7 = void 0;
|
|
await void 0;
|
|
Module38(c29961_4.length > 0, "analyticsLocationStack must have at least one location");
|
|
c29961_5 = c29961_4[c29961_4.length - 1];
|
|
c29961_6 = null;
|
|
if (c29961_0 != null) {
|
|
c29961_1 = c29961_0.guild?.id;
|
|
c29961_6 = new Set(c29961_0.guild?.features);
|
|
}
|
|
if (c29961_1 == null) {
|
|
break L28;
|
|
}
|
|
c29961_7 = GuildStore.getGuild(c29961_1);
|
|
const joinedAt = c29961_7?.joinedAt;
|
|
L19: {
|
|
if (joinedAt == null) {
|
|
if (c29961_6 != null && !c29961_6.has(GuildFeatures.PREVIEW_ENABLED)) {
|
|
if (c29961_0 != null) {
|
|
await InstantInviteActionCreators.acceptInvite({
|
|
inviteKey: c29961_0.code,
|
|
context: {
|
|
location: c29961_5
|
|
},
|
|
skipOnboarding: true
|
|
});
|
|
break L19;
|
|
}
|
|
break L19;
|
|
}
|
|
await startLurking(c29961_1, {}, {
|
|
shouldNavigate: true,
|
|
channelId: c29961_2,
|
|
messageId: c29961_3,
|
|
joinSource: JoinGuildSources.GAME_PROFILE_ANNOUNCEMENTS
|
|
}, c29961_4);
|
|
break L27;
|
|
}
|
|
}
|
|
transitionTo(Routes.CHANNEL(c29961_1, c29961_2, c29961_3), {
|
|
sourceLocationStack: c29961_4
|
|
});
|
|
break L28;
|
|
}
|
|
return void 0;
|
|
}
|
|
};
|