Files
discord-decomp/modules/guild_profile/GuildPopoutActionCreators.tsx
T
2026-11-01 12:12:55 +02:00

51 lines
1.2 KiB
TypeScript

// Metro module 13107 (f13108).
import { Endpoints } from "../../Constants";
import Dispatcher from "../../Dispatcher";
import { HTTP } from "../../_bundle/sendRequest";
export async function fetchGuildForPopout(guildId) {
let c27410_4 = 0;
let c30613_0, c30613_1;
L10: {
try {
c30613_0 = guildId;
c30613_1 = void 0;
Dispatcher.dispatch({
type: "GUILD_POPOUT_FETCH_START",
guildId
});
c27410_4 = 1;
c30613_1 = await HTTP.get({
url: Endpoints.GUILD_PREVIEW(guildId),
oldFormErrors: true,
rejectWithError: true
});
Dispatcher.dispatch({
type: "GUILD_POPOUT_FETCH_SUCCESS",
guildId: c30613_0,
guild: c30613_1.body
});
c27410_4 = 0;
} catch ($e) {
let r8 = $e;
if (c27410_4 !== 0) {
while (true) {
try {
c27410_4 = 0;
Dispatcher.dispatch({
type: "GUILD_POPOUT_FETCH_FAILURE",
guildId: c30613_0
});
break L10;
} catch ($e) {
r8 = $e;
if (c27410_4 === 0) {
break;
}
}
}
}
throw r8;
}
}
}