124 lines
6.9 KiB
TypeScript
124 lines
6.9 KiB
TypeScript
/* Metro module 9158; source: actions/CreateInviteModalActionCreators.tsx; dependencies: [9152, 661, 694, 683, 8879, 1244, 2] */
|
|
function _fun71812(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#71812, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9343:6, offset: 0x01d2da9c, size: 207 bytes, params: 8, frame: 19
|
|
var object2;
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const createInviteModalStore = importDefault(9152) /* metro dependency 9152: CreateInviteModalStore */;
|
|
const env0_4 = (require(661) /* metro dependency 661: Constants */).AnalyticEvents;
|
|
object2 = {init: init_71813, openSettings: openSettings, updateSettings: updateSettings,
|
|
resetSettings: resetSettings, createInvite: createInvite_71817, close: close_71820};
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('actions/CreateInviteModalActionCreators.tsx');
|
|
exports.default = object2;
|
|
}
|
|
|
|
function init_71813(a0, a1, {location, targetType, targetUserId, targetApplicationId, skipCreateInvite}) { // fn#71813, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9343:136, offset: 0x01d2db6b, size: 138 bytes, params: 4, frame: 20
|
|
location = location === undefined ? '' : location;
|
|
const value = importDefault(694) /* metro dependency 694: Dispatcher */;
|
|
value.dispatch({type: 'CREATE_INVITE_MODAL_INIT', guildId: a0, channelId: a1, targetType: targetType,
|
|
targetUserId: targetUserId, targetApplicationId: targetApplicationId});
|
|
if (!skipCreateInvite) {
|
|
this.createInvite(location, true);
|
|
}
|
|
}
|
|
|
|
function openSettings(a0, a1, a2, a3) { // fn#71814, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9343:383, offset: 0x01d2dbf5, size: 156 bytes, params: 5, frame: 18
|
|
const inviteSettings = CreateInviteModalStore.getInviteSettings();
|
|
const defaultImport = importDefault(694) /* metro dependency 694: Dispatcher */;
|
|
const dispatch = defaultImport.dispatch;
|
|
const object2 = {type: 'CREATE_INVITE_MODAL_OPEN'};
|
|
copyDataProperties(object2, inviteSettings, 'CREATE_INVITE_MODAL_OPEN');
|
|
object2['guildId'] = a0;
|
|
object2['channelId'] = a1;
|
|
object2['onClose'] = a3;
|
|
Reflect.apply(dispatch, defaultImport, [object2]);
|
|
const defaultImport2 = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
|
|
const track = defaultImport2.track;
|
|
const OPEN_MODAL = AnalyticEvents.OPEN_MODAL;
|
|
Reflect.apply(track, defaultImport2, [OPEN_MODAL, {type: 'Instant Invite', source: a2}]);
|
|
}
|
|
|
|
function updateSettings(a0) { // fn#71815, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9343:584, offset: 0x01d2dc91, size: 57 bytes, params: 2, frame: 13
|
|
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'CREATE_INVITE_MODAL_UPDATE_SETTINGS',
|
|
settings: a0});
|
|
}
|
|
|
|
function resetSettings() { // fn#71816, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9343:677, offset: 0x01d2dcca, size: 49 bytes, params: 1, frame: 13
|
|
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'CREATE_INVITE_MODAL_RESET_SETTINGS'});
|
|
}
|
|
|
|
function createInvite_71817(a0, a1) { // fn#71817, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9343:756, offset: 0x01d2dcfb, size: 304 bytes, params: 3, frame: 26
|
|
var code;
|
|
var object2;
|
|
var channelId;
|
|
var maxAge;
|
|
var maxUses;
|
|
var temporary;
|
|
var targetType;
|
|
var targetUserId;
|
|
var targetApplicationId;
|
|
var flags;
|
|
var roleIds;
|
|
var invite;
|
|
var createInvite;
|
|
var parseInt;
|
|
var value;
|
|
const pendingSettings = CreateInviteModalStore.getPendingSettings();
|
|
const value3 = null;
|
|
if (value3 != pendingSettings) {
|
|
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'CREATE_INVITE_MODAL_GENERATE_INVITE'});
|
|
channelId = pendingSettings.channelId;
|
|
maxAge = pendingSettings.maxAge;
|
|
maxUses = pendingSettings.maxUses;
|
|
temporary = pendingSettings.temporary;
|
|
targetType = pendingSettings.targetType;
|
|
targetUserId = pendingSettings.targetUserId;
|
|
targetApplicationId = pendingSettings.targetApplicationId;
|
|
flags = pendingSettings.flags;
|
|
roleIds = pendingSettings.roleIds;
|
|
invite = CreateInviteModalStore.getInvite();
|
|
code = a1 && value3 != invite ? invite.code : value3;
|
|
value = importDefault(8879) /* metro dependency 8879: InstantInviteActionCreators */;
|
|
createInvite = value.createInvite;
|
|
object2 = {temporary: temporary, validate: code};
|
|
parseInt = global.parseInt;
|
|
object2.max_age = parseInt(maxAge, 10);
|
|
parseInt = global.parseInt;
|
|
object2.max_uses = parseInt(maxUses, 10);
|
|
object2.target_type = targetType;
|
|
object2.target_user_id = targetUserId;
|
|
object2.target_application_id = targetApplicationId;
|
|
object2.flags = flags;
|
|
object2.role_ids = roleIds;
|
|
value = Reflect.apply(createInvite, value, [channelId, object2, a0]);
|
|
value.then(_fun71818, _fun71819);
|
|
}
|
|
}
|
|
|
|
function close_71820() { // fn#71820, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9343:1503, offset: 0x01d2def1, size: 67 bytes, params: 1, frame: 14
|
|
const onClose = CreateInviteModalStore.onClose;
|
|
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'CREATE_INVITE_MODAL_CLOSE'});
|
|
if (onClose != null) {
|
|
onClose();
|
|
}
|
|
}
|
|
|
|
function _fun71818() { // fn#71818, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9343:1230, offset: 0x01d2de2b, size: 60 bytes, params: 1, frame: 13
|
|
const value = environment.__proto__;
|
|
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'CREATE_INVITE_MODAL_GENERATE_INVITE_SUCCESS',
|
|
channelId: channelId});
|
|
}
|
|
|
|
function _fun71819(a0) { // fn#71819, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9343:1321, offset: 0x01d2de67, size: 138 bytes, params: 2, frame: 16
|
|
let value = environment.__proto__;
|
|
const value2 = undefined;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
const string = intl.string;
|
|
const WB1ip6 = (require(1244) /* metro dependency 1244: indexNative */).t.WB1ip6;
|
|
const r4 = (a0 == null ? value2 : a0.message) == null ? Reflect.apply(string, intl, [WB1ip6]) : a0.message;
|
|
value = importDefault(694) /* metro dependency 694: Dispatcher */;
|
|
value.dispatch({type: 'CREATE_INVITE_MODAL_GENERATE_INVITE_FAILURE', message: r4});
|
|
return value2;
|
|
}
|
|
|