This commit is contained in:
janisslsm committed 2026-11-01 12:12:55 +02:00
1 parent 1781d25a15
commit 732c0ad767
33051 files changed
+2591613 -3019689

No files matched your search

@@ -0,0 +1,3 @@
// Metro module 12998 (f12999).
export const MIDJOURNEY_GUILD_ID = "662267976984297473";
export const MIDJOURNEY_BOT_ID = "936929561302675456";
@@ -0,0 +1,25 @@
// Metro module 16644 (f16645).
import { MIDJOURNEY_GUILD_ID } from "./MidjourneyOnboardingConstants";
import { Routes } from "../../Constants";
import AutomaticLifecycleManager from "../../lib/AutomaticLifecycleManager";
import { isEligibleForMidjourneyRedirect, hasRedirectedToGuild } from "./MidjourneyOnboardingUtils";
import safeTransitionTo_native from "../links/safeTransitionTo.native";
class MidjourneyOnboardingManager extends AutomaticLifecycleManager {
actions = {
CHANNEL_CREATE: this.handleChannelCreate
};
async handleChannelCreate({ channel }) {
let c28479_0;
L13: {
c28479_0 = void 0;
if (isEligibleForMidjourneyRedirect(channel)) {
await hasRedirectedToGuild(MIDJOURNEY_GUILD_ID);
safeTransitionTo_native(Routes.CHANNEL(null, channel.id));
break L13;
}
return void 0;
}
}
}
const midjourneyOnboardingManager = new MidjourneyOnboardingManager();
export default midjourneyOnboardingManager;
@@ -0,0 +1,62 @@
// Metro module 12997 (f12998).
import GuildStore from "../../stores/GuildStore";
import SelectedGuildStore from "../../stores/SelectedGuildStore";
import { MIDJOURNEY_BOT_ID, MIDJOURNEY_GUILD_ID } from "./MidjourneyOnboardingConstants";
import { useStateFromStores } from "../../_bundle/Module589";
export function isMidjourneyOnboardingFlow(r4 = {}) {
let guildStore = r4.guildStore;
if (guildStore == null) {
guildStore = GuildStore;
}
const guild = guildStore.getGuild(MIDJOURNEY_GUILD_ID);
const r2 = guild?.joinedAt instanceof Date && Date.now() - guild.joinedAt.getTime() <= 3600000;
return guildStore.getGuildCount() === 1 && r2;
}
export function useIsMidjourneyOnboardingFlow() {
return useStateFromStores([GuildStore], () => {
let guildStore = ({
guildStore: GuildStore
}).guildStore;
if (guildStore == null) {
guildStore = GuildStore;
}
const guild = guildStore.getGuild(MIDJOURNEY_GUILD_ID);
const r2 = guild?.joinedAt instanceof Date && Date.now() - guild.joinedAt.getTime() <= 3600000;
return guildStore.getGuildCount() === 1 && r2;
}, []);
}
export function isEligibleForMidjourneyRedirect(a0) {
let r9 = a0.isDM() && a0.rawRecipients.length === 1 && a0.rawRecipients[0].id === MIDJOURNEY_BOT_ID;
if (r9) {
let guildStore = ({}).guildStore;
if (guildStore == null) {
guildStore = GuildStore;
}
const guild = guildStore.getGuild(MIDJOURNEY_GUILD_ID);
const r2 = guild?.joinedAt instanceof Date && Date.now() - guild.joinedAt.getTime() <= 3600000;
r9 = guildStore.getGuildCount() === 1 && r2;
}
return r9;
}
export function hasRedirectedToGuild(c20331_0) {
return new Promise((resolve, c27391_1) => {
let c27391_2;
const handleSelectedGuildUpdate2 = function handleSelectedGuildUpdate() {
if (SelectedGuildStore.getGuildId() === c20331_0) {
SelectedGuildStore.removeChangeListener(handleSelectedGuildUpdate2);
clearTimeout(c27391_2);
resolve();
}
};
if (SelectedGuildStore.getGuildId() !== c20331_0) {
c27391_2 = setTimeout(() => {
SelectedGuildStore.removeChangeListener(handleSelectedGuildUpdate2);
clearTimeout(c27391_2);
c27391_1();
}, 3000);
SelectedGuildStore.addChangeListener(handleSelectedGuildUpdate2);
} else {
resolve();
}
});
}