Files
discord-decomp/sources/modules/verification/native/ChangeEmailUtils.tsx
T
2026-07-28 01:06:53 +03:00

94 lines
4.8 KiB
TypeScript

/* Metro module 9008; source: modules/verification/native/ChangeEmailUtils.tsx; dependencies: [5, 8955, 7620, 9009, 676, 2] */
import Module00005 from '../../../by-id/module-00005.js'; /* Metro dependency 5 */
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ConstantsIOSModule from '../../../ConstantsIOS.tsx'; /* Metro dependency 676 */
import * as ChangeEmailStoreModule from '../ChangeEmailStore.tsx'; /* Metro dependency 8955 */
function _fun70086(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#70086, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9193:6, offset: 0x01cee036, size: 190 bytes, params: 8, frame: 18
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(FileImportTrackerModule).fileFinishedImporting('modules/verification/native/ChangeEmailUtils.tsx');
exports.saveEmail = function() {
return _saveEmail.apply(this, arguments);
};
exports.finishChangeEmailFlow = function(a0, a1) {
var CHANGE_EMAIL_COMPLETE = require(dependencyMap[4]).VerificationModalScenes.CHANGE_EMAIL_COMPLETE;
a0.replace(CHANGE_EMAIL_COMPLETE, {email: a1});
};
exports.finishVerifyEmailFlow = finishVerifyEmailFlow;
function _saveEmail() { // fn#70087, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9193:162, offset: 0x01cee0f4, size: 50 bytes, params: 1, frame: 14
return Module00005(_fun70089).apply(this, arguments);
function* _fun70089(a0, a1, a2) { // fn#70089, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9193:205, offset: 0x01cee131, size: 556 bytes, params: 4, frame: 22
var length;
var value8;
var value9;
if (false) {
return undefined;
}
value = environment.__proto__.__proto__;
let binding = env2_1;
const value3 = undefined;
const value4 = binding(env2_2[2]);
yield value4.saveAccountChanges(a0, {close: false});
const value5 = undefined;
if (true) {
if (value5.ok) {
return value5;
}
var body = value5.body;
var username = body == null ? value3 : body.username;
if (username != null) {
env2_0(env2_2[3]).showInvalidUsernameToast();
}
body = value5.body;
if ((body == null ? value3 : body.email) != null) {
binding = env2_4;
binding(env2_5.EMAIL, value5.body.email[0]);
length = a1.getState().routes.length;
binding = env2_0;
value9 = a2(binding(env2_2[4]).VerificationModalScenes.ENTER_EMAIL);
if (value9 !== -1) {
a1.pop(length - value9 - 1);
} else {
a1.replace(env2_0(env2_2[4]).VerificationModalScenes.ENTER_EMAIL);
}
return null;
}
body = value5.body;
if ((body == null ? value3 : body.email_token) != null) {
binding = env2_4;
binding(env2_5.EMAIL_TOKEN, value5.body.email_token[0]);
length = a1.getState().routes.length;
binding = env2_0;
value8 = a2(binding(env2_2[4]).VerificationModalScenes.CONFIRM_EMAIL_CHANGE_CODE);
if (value8 !== -1) {
a1.pop(length - value8 - 1);
} else {
a1.replace(env2_0(env2_2[4]).VerificationModalScenes.CONFIRM_EMAIL_CHANGE_CODE);
}
}
}
return value5;
}
}
function finishVerifyEmailFlow(a0, a1) { // fn#70092, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9193:1239, offset: 0x01cee39c, size: 137 bytes, params: 3, frame: 16
const getState = a0.getState;
const length = Reflect.apply(getState, a0, []).routes.length;
const VerificationModalScenes = (ConstantsIOSModule).VerificationModalScenes;
const RESEND_EMAIL = VerificationModalScenes.RESEND_EMAIL;
const value2 = a1(RESEND_EMAIL);
if (value2 !== -1) {
a0.pop(length - value2);
} else {
a0.replace(VerificationModalScenes.RESEND_EMAIL);
}
}
}
global.__d(_fun70086, 9008, [5, 8955, 7620, 9009, 676,
2]) /* metro module 9008, dependencies: [5, 8955, 7620, 9009, 676, 2] */;