107 lines
4.7 KiB
TypeScript
107 lines
4.7 KiB
TypeScript
/* Metro module 10297; source: modules/guild_settings/GuildSettingsModalMembersStore.tsx; dependencies: [6, 7, 15, 17, 18, 1945, 661, 566, 694, 2] */
|
|
function _fun79898(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#79898, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10483:6, offset: 0x01e66767, size: 413 bytes, params: 8, frame: 21
|
|
const closure = function() {
|
|
env0_7 = null;
|
|
env0_8 = false;
|
|
env0_9 = null;
|
|
env0_10 = null;
|
|
env0_11 = null;
|
|
};
|
|
const closure2 = function() {
|
|
env0_9 = null;
|
|
};
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_0 = importDefault(6) /* metro dependency 6 */;
|
|
const env0_1 = importDefault(7) /* metro dependency 7 */;
|
|
const env0_2 = importDefault(15) /* metro dependency 15 */;
|
|
const env0_3 = importDefault(17) /* metro dependency 17 */;
|
|
const env0_4 = importDefault(18) /* metro dependency 18 */;
|
|
const guildMemberStore = importDefault(1945) /* metro dependency 1945: GuildMemberStore */;
|
|
const env0_6 = (require(661) /* metro dependency 661: Constants */).FormStates;
|
|
const Store = (importDefault(566) /* metro dependency 566: flux */).Store;
|
|
let value = _fun79904(Store);
|
|
value.displayName = 'GuildSettingsModalMembersStore';
|
|
value = new value(importDefault(694) /* metro dependency 694: Dispatcher */,
|
|
{GUILD_SETTINGS_MODAL_MEMBERS_START_EDITING: function({guildId, userId}) {
|
|
var value2 = GuildMemberStore.getMember(guildId, userId);
|
|
if (value2 == null) {
|
|
return false;
|
|
}
|
|
env0_7 = FormStates.OPEN;
|
|
env0_8 = true;
|
|
env0_10 = userId;
|
|
env0_11 = value2.roles;
|
|
}, GUILD_SETTINGS_MODAL_MEMBERS_STOP_EDITING: closure, GUILD_SETTINGS_MODAL_MEMBERS_ROLES_SAVE_COMPLETE: closure,
|
|
GUILD_SETTINGS_MODAL_MEMBERS_TOGGLE_ROLE: GUILD_SETTINGS_MODAL_MEMBERS_TOGGLE_ROLE,
|
|
GUILD_SETTINGS_MODAL_MEMBERS_ROLES_SAVE: function() {
|
|
env0_7 = FormStates.SUBMITTING;
|
|
}, GUILD_SETTINGS_MODAL_MEMBERS_START_EDITING_NICKNAME: closure2,
|
|
GUILD_SETTINGS_MODAL_MEMBERS_CHANGE_NICKNAME_SUCCESS: closure2,
|
|
GUILD_SETTINGS_MODAL_MEMBERS_CHANGE_NICKNAME_FAILURE: function(a0) {
|
|
env0_9 = a0.error;
|
|
}});
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/guild_settings/GuildSettingsModalMembersStore.tsx');
|
|
exports.default = value;
|
|
}
|
|
|
|
function _isNativeReflectConstruct_79899() { // fn#79899, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10483:179, offset: 0x01e66904, size: 98 bytes, params: 1, frame: 18
|
|
var Boolean;
|
|
var prototype;
|
|
var valueOf;
|
|
var call;
|
|
var Reflect;
|
|
var construct;
|
|
var closure;
|
|
var value;
|
|
var error;
|
|
try {
|
|
Boolean = global.Boolean;
|
|
prototype = Boolean.prototype;
|
|
valueOf = prototype.valueOf;
|
|
call = valueOf.call;
|
|
Reflect = global.Reflect;
|
|
construct = Reflect.construct;
|
|
Boolean = global.Boolean;
|
|
closure = function() {
|
|
};
|
|
value = Reflect.apply(construct, Reflect, [Boolean, [], closure]);
|
|
value = Reflect.apply(call, valueOf, [value]);
|
|
var result = !value;
|
|
} catch (error) {
|
|
}
|
|
return (_isNativeReflectConstruct_79899_isNativeReflectConstruct = function() {
|
|
return !!result;
|
|
})();
|
|
}
|
|
|
|
function _fun79904(a0) { // fn#79904, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10483:528, offset: 0x01e66985, size: 199 bytes, params: 2, frame: 16
|
|
const closure = GuildSettingsModalMembersStore;
|
|
env0_4(closure, a0);
|
|
return env0_1(closure, [{key: 'initialize', value: function() {
|
|
this.waitFor(GuildMemberStore);
|
|
}}, {key: 'isSubmitting', get: get_79907}, {key: 'isEditing', get: get_79908}, {key: 'roles', get: get_79909},
|
|
{key: 'memberId', get: get_79910}, {key: 'nicknameError', get: get_79911}]);
|
|
}
|
|
|
|
function GUILD_SETTINGS_MODAL_MEMBERS_TOGGLE_ROLE({roleId, state}) { // fn#79913, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10483:1603, offset: 0x01e66a9c, size: 102 bytes, params: 2, frame: 16
|
|
var value2;
|
|
var items2;
|
|
var value3;
|
|
if (env0_11 == null) {
|
|
return false;
|
|
}
|
|
const binding = env0_11;
|
|
if (state) {
|
|
items2 = [];
|
|
value3 = arraySpread(items2, binding, 0, binding);
|
|
items2[value3] = roleId;
|
|
value3 + 1;
|
|
} else {
|
|
value2 = binding.filter(function(a0) {
|
|
return a0 !== roleId;
|
|
});
|
|
}
|
|
}
|
|
|