152 lines
7.6 KiB
TypeScript
152 lines
7.6 KiB
TypeScript
/* Metro module 7008; source: stores/UserSettingsAccountStore.tsx; dependencies: [6, 7, 15, 17, 18, 1878, 661, 566, 694, 2] */
|
|
import ClassCallCheck from '../by-id/module-00006-ClassCallCheck.js'; /* Metro dependency 6 */
|
|
import CreateClass from '../by-id/module-00007-CreateClass.js'; /* Metro dependency 7 */
|
|
import PossibleConstructorReturn from '../by-id/module-00015-PossibleConstructorReturn.js'; /* Metro dependency 15 */
|
|
import Module00017 from '../by-id/module-00017.js'; /* Metro dependency 17 */
|
|
import Inherits from '../by-id/module-00018-Inherits.js'; /* Metro dependency 18 */
|
|
import Flux from '../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
|
|
import UserStore from './UserStore.tsx'; /* Metro dependency 1878 */
|
|
import * as FileImportTrackerModule from '../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as ConstantsModule from '../Constants.tsx'; /* Metro dependency 661 */
|
|
|
|
function _fun55477(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#55477, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7186:6, offset: 0x013a8362, size: 418 bytes, params: 8, frame: 22
|
|
const USER_SETTINGS_MODAL_INIT_554812 = USER_SETTINGS_MODAL_INIT_55481;
|
|
const closure2 = function() {
|
|
env0_7 = FormStates.CLOSED;
|
|
env0_9 = null;
|
|
env0_8 = {};
|
|
};
|
|
const closure3 = function() {
|
|
env0_7 = FormStates.OPEN;
|
|
env0_8 = {};
|
|
};
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const FormStates = (ConstantsModule).FormStates;
|
|
let env0_7 = FormStates.CLOSED;
|
|
let env0_8 = {};
|
|
const Store = (Flux).Store;
|
|
let value = _fun55484(Store);
|
|
value.displayName = 'UserSettingsAccountStore';
|
|
value = new value(importDefault(694) /* metro dependency 694: Dispatcher */, {USER_SETTINGS_MODAL_OPEN: function() {
|
|
USER_SETTINGS_MODAL_INIT_55481();
|
|
}, USER_SETTINGS_MODAL_INIT: USER_SETTINGS_MODAL_INIT_554812, USER_SETTINGS_MODAL_CLOSE: closure2, LOGOUT: closure2,
|
|
USER_SETTINGS_MODAL_SUBMIT: function() {
|
|
env0_7 = FormStates.SUBMITTING;
|
|
}, USER_SETTINGS_MODAL_SUBMIT_FAILURE: function(a0) {
|
|
if (CLOSED !== FormStates.SUBMITTING) {
|
|
return false;
|
|
}
|
|
env0_7 = FormStates.OPEN;
|
|
env0_8 = a0.errors ?? ({});
|
|
}, USER_SETTINGS_MODAL_UPDATE_ACCOUNT: USER_SETTINGS_MODAL_UPDATE_ACCOUNT,
|
|
USER_SETTINGS_MODAL_SUBMIT_COMPLETE: closure3, USER_SETTINGS_MODAL_RESET: USER_SETTINGS_MODAL_RESET});
|
|
(FileImportTrackerModule).fileFinishedImporting('stores/UserSettingsAccountStore.tsx');
|
|
exports.default = value;
|
|
function _isNativeReflectConstruct_55478() { // fn#55478, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7186:179, offset: 0x013a8504, size: 94 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_55478_isNativeReflectConstruct = function() {
|
|
return !!result;
|
|
})();
|
|
}
|
|
|
|
function USER_SETTINGS_MODAL_INIT_55481() { // fn#55481, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7186:406, offset: 0x013a8562, size: 161 bytes, params: 1, frame: 14
|
|
const currentUser = UserStore.getCurrentUser();
|
|
if (currentUser == null) {
|
|
USER_SETTINGS_MODAL_CLOSE();
|
|
} else {
|
|
env0_7 = FormStates.OPEN;
|
|
env0_8 = {};
|
|
var object = {};
|
|
object.userId = currentUser.id;
|
|
var username = currentUser.username;
|
|
object.username = username;
|
|
object.discriminator = currentUser.discriminator;
|
|
object.email = currentUser.email;
|
|
object.avatar = currentUser.avatar;
|
|
object.password = '';
|
|
object.newPassword = null;
|
|
object.claimed = currentUser.isClaimed();
|
|
copyDataProperties({}, object, '');
|
|
}
|
|
}
|
|
|
|
function _fun55484(a0) { // fn#55484, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7186:776, offset: 0x013a863f, size: 139 bytes, params: 2, frame: 16
|
|
const UserSettingsAccountStore2 = UserSettingsAccountStore;
|
|
Inherits(UserSettingsAccountStore2, a0);
|
|
return CreateClass(UserSettingsAccountStore2, [{key: 'initialize', value: function() {
|
|
this.waitFor(UserStore);
|
|
}}, {key: 'getErrors', value: value_55487}, {key: 'getSubmitting', value: function() {
|
|
return CLOSED === FormStates.SUBMITTING;
|
|
}}, {key: 'getSettings', value: value_55489}]);
|
|
function UserSettingsAccountStore() { // fn#55485, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7186:788, offset: 0x0113ed59, size: 113 bytes, params: 1, frame: 20
|
|
const value = environment.__proto__;
|
|
env1_0(this, UserSettingsAccountStore);
|
|
const value3 = env1_3(UserSettingsAccountStore);
|
|
return env1_2(this, _isNativeReflectConstruct_55478() ? global.Reflect.construct(value3, arguments,
|
|
env1_3(this).constructor) : value3.apply(this, arguments));
|
|
}
|
|
|
|
function value_55487() { // fn#55487, offset: 0x00fbd9d4, size: 9 bytes, params: 1, frame: 1
|
|
return env1_8;
|
|
}
|
|
|
|
function value_55489() { // fn#55489, offset: 0x00e07a77, size: 9 bytes, params: 1, frame: 1
|
|
return env1_9;
|
|
}
|
|
|
|
}
|
|
|
|
function USER_SETTINGS_MODAL_UPDATE_ACCOUNT({settings}) { // fn#55493, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7186:1813, offset: 0x013a8736, size: 59 bytes, params: 2, frame: 13
|
|
const binding = env0_9;
|
|
env0_9 = binding == null ? {} : env0_9;
|
|
const object = {};
|
|
copyDataProperties(object, settings, copyDataProperties(object, env0_9, binding));
|
|
}
|
|
|
|
function USER_SETTINGS_MODAL_RESET() { // fn#55494, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7186:1974, offset: 0x013a8771, size: 134 bytes, params: 1, frame: 15
|
|
var object;
|
|
const currentUser = UserStore.getCurrentUser();
|
|
USER_SETTINGS_MODAL_SUBMIT_COMPLETE();
|
|
if (currentUser != null) {
|
|
object = {};
|
|
object.userId = currentUser.id;
|
|
object.username = currentUser.username;
|
|
object.discriminator = currentUser.discriminator;
|
|
object.email = currentUser.email;
|
|
object.avatar = currentUser.avatar;
|
|
object.password = '';
|
|
object.newPassword = null;
|
|
object.claimed = currentUser.isClaimed();
|
|
copyDataProperties({}, object, '');
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun55477, 7008, [6, 7, 15, 17, 18, 1878, 661, 566, 694,
|
|
2]) /* metro module 7008, dependencies: [6, 7, 15, 17, 18, 1878, 661, 566, 694, 2] */;
|