decord/alpha/source/actions/CreateInviteModalActionCreators.tsx

115 lines
4 KiB
TypeScript
Raw Permalink Normal View History

2026-10-12 06:59:38 +00:00
// Module ID: 8690
// Function ID: 8691
// Name: CreateInviteModalActionCreators
2026-10-12 06:59:38 +00:00
// Dependencies: [8684, 1085, 584, 1265, 8497, 1126, 2]
2026-07-20 16:05:17 +00:00
2026-10-12 06:59:38 +00:00
// Module 8690 (CreateInviteModalActionCreators)
2026-10-03 08:58:59 +00:00
import DispatcherDefault from "Dispatcher" /* 584 */;
import Constants from "Constants" /* 1085 */;
2026-10-09 10:00:15 +00:00
import AnalyticsUtilsDefault from "AnalyticsUtils" /* 1265 */;
2026-10-12 06:59:38 +00:00
import CreateInviteModalStore from "CreateInviteModalStore" /* 8684 */;
2026-10-03 08:58:59 +00:00
import size from "module_2" /* 2 */;
2026-07-23 10:11:24 +00:00
2026-10-03 08:58:59 +00:00
const require = globalThis.__r;
2026-07-20 16:05:17 +00:00
2026-10-03 08:58:59 +00:00
const AnalyticEvents = Constants.AnalyticEvents;
let obj = {
2026-07-20 16:05:17 +00:00
init(guildId, channelId, location) {
2026-10-03 08:58:59 +00:00
let skipCreateInvite;
let targetApplicationId;
let targetType;
let targetUserId;
2026-07-20 16:05:17 +00:00
let str = location.location;
if (str === undefined) {
str = "";
}
({ targetType, targetUserId, targetApplicationId, skipCreateInvite } = location);
2026-10-03 08:58:59 +00:00
const obj = DispatcherDefault;
const obj2 = { type: "CREATE_INVITE_MODAL_INIT", guildId, channelId, targetType, targetUserId, targetApplicationId };
obj.dispatch(obj2);
2026-07-20 16:05:17 +00:00
if (!skipCreateInvite) {
2026-07-29 08:29:29 +00:00
const self = this;
const invite = this.createInvite(str, true);
2026-07-20 16:05:17 +00:00
}
},
2026-07-29 08:29:29 +00:00
openSettings(guildId, channelId, source, onClose) {
const inviteSettings = CreateInviteModalStore.getInviteSettings();
2026-10-03 08:58:59 +00:00
const obj = { type: "CREATE_INVITE_MODAL_OPEN", guildId, channelId, onClose };
const dispatch = DispatcherDefault.dispatch;
DispatcherDefault;
2026-07-20 16:05:17 +00:00
const merged = Object.assign(inviteSettings);
2026-10-03 08:58:59 +00:00
dispatch(obj);
const obj2 = AnalyticsUtilsDefault;
const obj3 = { type: "Instant Invite", source };
obj2.track(AnalyticEvents.OPEN_MODAL, obj3);
2026-07-20 16:05:17 +00:00
},
updateSettings(settings) {
2026-10-03 08:58:59 +00:00
const obj = DispatcherDefault;
const obj2 = { type: "CREATE_INVITE_MODAL_UPDATE_SETTINGS", settings };
obj.dispatch(obj2);
2026-07-20 16:05:17 +00:00
},
resetSettings() {
2026-10-03 08:58:59 +00:00
const obj = DispatcherDefault;
obj.dispatch({ type: "CREATE_INVITE_MODAL_RESET_SETTINGS" });
2026-07-20 16:05:17 +00:00
},
createInvite(arg0, arg1) {
2026-10-03 08:58:59 +00:00
let flags;
let maxAge;
let maxUses;
let roleIds;
let targetApplicationId;
let targetType;
let targetUserId;
let temporary;
let obj = CreateInviteModalStore;
const pendingSettings = CreateInviteModalStore.getPendingSettings();
2026-07-20 16:05:17 +00:00
if (null != pendingSettings) {
2026-10-09 10:00:15 +00:00
const obj4 = DispatcherDefault;
obj4.dispatch({ type: "CREATE_INVITE_MODAL_GENERATE_INVITE" });
2026-07-20 16:05:17 +00:00
const channelId = pendingSettings.channelId;
({ maxAge, maxUses, temporary, targetType, targetUserId, targetApplicationId, flags, roleIds } = pendingSettings);
2026-10-03 08:58:59 +00:00
const invite = obj.getInvite();
2026-07-20 16:05:17 +00:00
let code = null;
2026-10-09 10:00:15 +00:00
const tmp6 = importDefault;
2026-07-20 16:05:17 +00:00
if (arg1) {
code = null;
if (null != invite) {
code = invite.code;
}
}
2026-10-09 10:00:15 +00:00
let obj2 = { temporary, validate: code, max_age: maxAge, max_uses: maxUses, target_type: targetType, target_user_id: targetUserId, target_application_id: targetApplicationId, flags, role_ids: roleIds };
2026-10-12 06:59:38 +00:00
const tmp6Result = tmp6(8497);
2026-10-09 10:00:15 +00:00
const invite1 = tmp6Result.createInvite(channelId, obj2, arg0);
2026-07-20 16:05:17 +00:00
invite1.then(() => {
2026-10-03 08:58:59 +00:00
const obj = DispatcherDefault;
const obj2 = { type: "CREATE_INVITE_MODAL_GENERATE_INVITE_SUCCESS", channelId };
obj.dispatch(obj2);
2026-07-20 16:05:17 +00:00
}, (message) => {
2026-10-03 08:58:59 +00:00
const intl = channelId(dependencyMap[5]).intl;
message = intl.string(channelId(dependencyMap[5]).t.WB1ip6);
let message1;
2026-10-03 08:58:59 +00:00
const tmp = dependencyMap;
2026-07-29 08:29:29 +00:00
if (message != null) {
message1 = message.message;
2026-07-20 16:05:17 +00:00
}
if (null != message1) {
2026-07-20 16:05:17 +00:00
message = message.message;
}
2026-10-03 08:58:59 +00:00
const obj = require("Dispatcher");
obj.dispatch({ type: "CREATE_INVITE_MODAL_GENERATE_INVITE_FAILURE", message });
2026-07-20 16:05:17 +00:00
});
}
},
close() {
const onClose = CreateInviteModalStore.onClose;
2026-10-03 08:58:59 +00:00
const obj = DispatcherDefault;
obj.dispatch({ type: "CREATE_INVITE_MODAL_CLOSE" });
2026-07-29 08:29:29 +00:00
if (onClose != null) {
2026-07-20 16:05:17 +00:00
onClose();
}
}
};
2026-10-03 08:58:59 +00:00
const result = size.fileFinishedImporting("actions/CreateInviteModalActionCreators.tsx");
export default obj;