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

169 lines
9.8 KiB
TypeScript

/* Metro module 12021; source: modules/nuf/native/NUFActionCreators.tsx; dependencies: [5, 11994, 5040, 1878, 12022, 661, 9006, 694, 5080, 12023, 1962, 9443, 12043, 12044, 676, 11997, 12001, 2] */
import Module00005 from '../../../by-id/module-00005.js'; /* Metro dependency 5 */
import Dispatcher from '../../../Dispatcher.tsx'; /* Metro dependency 694 */
import UserStore from '../../../stores/UserStore.tsx'; /* Metro dependency 1878 */
import ConnectedAccountsStore from '../../../stores/ConnectedAccountsStore.tsx'; /* Metro dependency 5040 */
import ModalActionCreators from '../../../actions/ModalActionCreators.tsx'; /* Metro dependency 5080 */
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ConstantsModule from '../../../Constants.tsx'; /* Metro dependency 661 */
import * as CreateGuildConstantsModule from '../../create_guild/native/CreateGuildConstants.tsx'; /* Metro dependency 9006 */
import * as ContactSyncModalStoreModule from '../../contact_sync/native/ContactSyncModalStore.tsx'; /* Metro dependency 11994 */
import * as NUFConstantsModule from '../NUFConstants.tsx'; /* Metro dependency 12022 */
function _fun92343(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#92343, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12207:6, offset: 0x020852ed, size: 383 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(FileImportTrackerModule).fileFinishedImporting('modules/nuf/native/NUFActionCreators.tsx');
exports.startOnboarding = startOnboarding_92347;
exports.nextOnboardingStep = nextOnboardingStep;
exports.previousOnboardingStep = previousOnboardingStep;
exports.transitionToNUFGuildTemplatesModal = transitionToNUFGuildTemplatesModal;
exports.transitionToHubEmailConnectionModal = transitionToHubEmailConnectionModal;
exports.openDiscoverabilityModal = openDiscoverabilityModal;
exports.closeDiscoverabilityModal = closeDiscoverabilityModal;
exports.startContactSyncForDiscoverability = function() {
return _startContactSyncForDiscoverability.apply(this, arguments);
};
exports.toggleDiscoverabilityForUser = function() {
var r3;
var value2 = UserStore.getCurrentUser();
var value3 = undefined;
r3 = value2 == null ? value3 : value2.phone;
var value4 = useContactSyncModalStore.getState();
var r1 = value4.allowPhone || value4.allowEmail;
if (r3 != null) {
setAllowSync(!r1);
} else {
setAllowSync(false);
if (!r1) {
setAllowEmail(true);
}
}
return value3;
};
function _startContactSyncForDiscoverability() { // fn#92344, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12207:319, offset: 0x0208546c, size: 50 bytes, params: 1, frame: 14
return Module00005(_fun92346).apply(this, arguments);
function* _fun92346(a0) { // fn#92346, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12207:412, offset: 0x020854a9, size: 263 bytes, params: 2, frame: 19
if (false) {
return undefined;
}
value = environment.__proto__.__proto__;
let binding = env2_9;
const currentUser = binding.getCurrentUser();
const value4 = undefined;
const phone = currentUser == null ? value4 : currentUser.phone;
binding = env2_8;
const getLocalAccount = binding.getLocalAccount;
const CONTACTS = env2_11.CONTACTS;
const isContactSyncEnabled2 = env2_0(env2_2[15]).isContactSyncEnabled(Reflect.apply(getLocalAccount, binding,
[CONTACTS]));
if (phone == null) {
throw new global.Error('Cannot start contact sync without a phone number');
}
env2_6(a0);
const value7 = env2_1(env2_2[16]);
yield value7.updateContactSyncEnabled({enabled: isContactSyncEnabled2, name: a0});
if (false) {
return undefined;
}
value = env2_0(env2_2[15]);
yield value.uploadContacts('[]', true);
return value4;
}
}
function startOnboarding_92347() { // fn#92347, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12207:846, offset: 0x020855b0, size: 49 bytes, params: 1, frame: 13
(Dispatcher).dispatch({type: 'ONBOARDING_START'});
}
function nextOnboardingStep({skip, skipAttempt}) { // fn#92348, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12207:917, offset: 0x020855e1, size: 86 bytes, params: 2, frame: 15
skip = !(skip === undefined) && skip;
skipAttempt = !(skipAttempt === undefined) && skipAttempt;
Dispatcher.dispatch({type: 'ONBOARDING_STEP', skip: skip, skipAttempt: skipAttempt});
}
function previousOnboardingStep() { // fn#92349, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12207:1040, offset: 0x02085637, size: 51 bytes, params: 1, frame: 12
(Dispatcher).dispatch({'type': 'ONBOARDING_STEP', 'back': true});
}
function transitionToNUFGuildTemplatesModal(a0) { // fn#92350, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12207:1163, offset: 0x0208566a, size: 71 bytes, params: 2, frame: 16
const env0_0 = a0;
const defaultImport = ModalActionCreators;
defaultImport.pushLazy(Module00005(_fun92352), {}, IN_APP_GUILD_TEMPLATES_MODAL_KEY);
function* _fun92352() { // fn#92352, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12207:1230, offset: 0x020856bc, size: 94 bytes, params: 1, frame: 14
if (false) {
return undefined;
}
value = environment.__proto__.__proto__;
const binding = env2_0;
const binding2 = env2_2;
value = binding(binding2[10]);
let property = binding2[9];
yield value(property, binding2.paths);
value = undefined;
if (false) {
return value;
}
property = value.default;
value = environment.__proto__;
property.modalConfig = {animation: require};
return property;
}
}
function transitionToHubEmailConnectionModal(a0) { // fn#92353, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12207:1372, offset: 0x0208571a, size: 72 bytes, params: 2, frame: 15
let value = a1;
const r1 = value !== undefined ? value : false;
value = importDefault(9443) /* metro dependency 9443: HubEmailConnectionModalActionCreators */;
value.open({onCloseExtra: onCloseExtra, displayStudentPrompt: r1}, a0);
function onCloseExtra(a0) { // fn#92354, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12207:1453, owner: transitionToHubEmailConnectionModal.onCloseExtra, offset: 0x02085762, size: 91 bytes, params: 2, frame: 13
const value = environment.__proto__;
if (a0) {
(require(12043) /* metro dependency 12043: NUFActionCreators */).setNewUserFlowCompleted();
} else {
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'ONBOARDING_STEP'});
}
}
}
function openDiscoverabilityModal() { // fn#92355, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12207:1593, offset: 0x020857bd, size: 64 bytes, params: 1, frame: 16
const defaultImport = ModalActionCreators;
defaultImport.pushLazy(Module00005(_fun92357), {}, NUF_DISCOVERABILITY_MODAL_KEY);
function* _fun92357() { // fn#92357, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12207:1649, offset: 0x02085808, size: 119 bytes, params: 1, frame: 17
if (false) {
return undefined;
}
value = environment.__proto__.__proto__;
const binding = env2_0;
const binding2 = env2_2;
const value3 = binding(binding2[10]);
let property = binding2[13];
yield value3(property, binding2.paths);
const value4 = undefined;
if (false) {
return value4;
}
property = value4.default;
const ModalAnimation = env2_0(env2_2[14]).ModalAnimation;
const SLIDE_IN_OUT = ModalAnimation.SLIDE_IN_OUT;
property.modalConfig = {animation: SLIDE_IN_OUT};
return property;
}
}
function closeDiscoverabilityModal(a0) { // fn#92358, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12207:1817, offset: 0x0208587f, size: 84 bytes, params: 2, frame: 14
(ModalActionCreators).popWithKey(NUF_DISCOVERABILITY_MODAL_KEY);
(Dispatcher).dispatch({type: 'ONBOARDING_STEP', skip: a0});
}
}
global.__d(_fun92343, 12021, [5, 11994, 5040, 1878, 12022, 661, 9006, 694, 5080, 12023, 1962, 9443, 12043, 12044,
676, 11997, 12001,
2]) /* metro module 12021, dependencies: [5, 11994, 5040, 1878, 12022, 661, 9006, 694, 5080, 12023, 1962, 9443, 12043, 12044, 676, 11997, 12001, 2] */;