decord/source/modules/guild_templates/AcceptGuildTemplateActionCreators.tsx

52 lines
2 KiB
TypeScript
Raw Normal View History

// Module ID: 11935
// Function ID: 11936
// Name: AcceptGuildTemplateActionCreators
// Dependencies: [5358, 1979, 1074, 573, 1272, 7445, 2]
2026-07-20 16:05:17 +00:00
// Module 11935 (AcceptGuildTemplateActionCreators)
import DispatcherDefault from "Dispatcher" /* 573 */;
import transitionToGuild from "transitionToGuild" /* 7445 */;
import GatewayConnectionStore from "GatewayConnectionStore" /* 5358 */;
import GuildStore from "GuildStore" /* 1979 */;
2026-07-23 10:11:24 +00:00
require = fn;
const Endpoints = fn(1074).Endpoints;
const size = fn(2);
let result = size.fileFinishedImporting("modules/guild_templates/AcceptGuildTemplateActionCreators.tsx");
2026-07-20 16:05:17 +00:00
export default {
acceptGuildTemplate(code, name, first1) {
importDefault = name;
2026-08-24 06:08:38 +00:00
dependencyMap = first1;
DispatcherDefault.dispatch({ type: "GUILD_TEMPLATE_ACCEPT", code });
const obj2 = { type: "GUILD_TEMPLATE_ACCEPT", code };
return new Promise((code, arg1) => {
name = arg1;
const HTTP = code(icon[4]).HTTP;
const request = { url: Endpoints.UNRESOLVED_GUILD_TEMPLATE(code), body: { name, icon }, oldFormErrors: true, rejectWithError: code(icon[4]).rejectWithMigratedError() };
const obj = { name, icon };
let obj3 = code(icon[4]);
HTTP.post(request).then((body) => {
2026-07-20 16:05:17 +00:00
body = body.body;
closure_1(dependencyMap[3]).dispatch({ type: "GUILD_TEMPLATE_ACCEPT_SUCCESS", code, guild: body });
if (connected.isConnected()) {
const result = GuildStore.addConditionalChangeListener(() => {
if (null != GuildStore.getGuild(body.id)) {
transitionToGuild.transitionToGuild(tmp.id);
2026-07-29 08:29:29 +00:00
body(tmp);
2026-07-20 16:05:17 +00:00
return false;
}
});
} else {
code(dependencyMap[5]).transitionToGuild(body.id);
2026-07-20 16:05:17 +00:00
body(body);
const obj3 = code(dependencyMap[5]);
2026-07-20 16:05:17 +00:00
}
}, (body) => {
DispatcherDefault.dispatch({ type: "GUILD_TEMPLATE_ACCEPT_FAILURE", code });
closure_1(body.body);
2026-07-20 16:05:17 +00:00
});
});
}
};