Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4790.js (118.4 MB)
188 lines
6.6 KiB
TypeScript
188 lines
6.6 KiB
TypeScript
// Module ID: 12774
|
|
// Function ID: 12775
|
|
// Name: NUFActionCreators
|
|
// Dependencies: [5, 12747, 5331, 1371, 12775, 1074, 7030, 573, 4808, 12776, 1896, 12813, 12816, 12817, 1093, 12750, 12754, 2]
|
|
// Exports: closeDiscoverabilityModal, nextOnboardingStep, openDiscoverabilityModal, previousOnboardingStep, startContactSyncForDiscoverability, startOnboarding, toggleDiscoverabilityForUser, transitionToHubEmailConnectionModal, transitionToNUFGuildTemplatesModal
|
|
|
|
// Module 12774 (NUFActionCreators)
|
|
import DispatcherDefault from "Dispatcher" /* 573 */;
|
|
import ModalActionCreatorsDefault from "ModalActionCreators" /* 4808 */;
|
|
import ContactSyncUtils from "ContactSyncUtils" /* 12750 */;
|
|
import ContactSyncActionCreatorsDefault from "ContactSyncActionCreators" /* 12754 */;
|
|
import HubEmailConnectionModalActionCreatorsDefault from "HubEmailConnectionModalActionCreators" /* 12813 */;
|
|
import nuf_NUFActionCreators from "nuf/NUFActionCreators" /* 12816 */;
|
|
import asyncGeneratorStep from "asyncGeneratorStep" /* 5 */;
|
|
import ConnectedAccountsStore from "ConnectedAccountsStore" /* 5331 */;
|
|
import UserStore from "UserStore" /* 1371 */;
|
|
|
|
const require = globalThis.__r;
|
|
|
|
require = fn;
|
|
let closure_13 = async function _startContactSyncForDiscoverability(arg0, value) {
|
|
if (c3 === 2) {
|
|
c3 = 3;
|
|
throw new TypeError("Generator functions may not be called on executing generators");
|
|
} else if (tmp3 === 3) {
|
|
if (arg0 === 1) {
|
|
throw value;
|
|
} else if (arg0 === 2) {
|
|
const obj3 = { value, done: true };
|
|
return obj3;
|
|
} else {
|
|
return { value: "HermesInternal", done: null };
|
|
}
|
|
} else {
|
|
try {
|
|
c3 = 2;
|
|
if (0 === c2) {
|
|
if (arg0 === 1) {
|
|
c3 = 3;
|
|
throw value;
|
|
} else if (arg0 === 2) {
|
|
c3 = 3;
|
|
const obj4 = { value, done: true };
|
|
return obj4;
|
|
} else {
|
|
closure_1 = tmp4;
|
|
currentUser = currentUser.getCurrentUser();
|
|
let phone;
|
|
if (currentUser != null) {
|
|
phone = currentUser.phone;
|
|
}
|
|
localAccount = localAccount.getLocalAccount(constants.CONTACTS);
|
|
ContactSyncUtils;
|
|
if (null == phone) {
|
|
const _Error = Error;
|
|
const error = new Error("Cannot start contact sync without a phone number");
|
|
throw error;
|
|
} else {
|
|
timestampProducer(tmp30);
|
|
const obj6 = { enabled: tmp15, name: tmp30 };
|
|
c2 = 1;
|
|
c3 = 1;
|
|
const obj7 = { value: ContactSyncActionCreatorsDefault.updateContactSyncEnabled(obj6), done: false };
|
|
return obj7;
|
|
}
|
|
}
|
|
} else if (1 === tmp4) {
|
|
if (arg0 === 1) {
|
|
c3 = 3;
|
|
throw value;
|
|
} else if (arg0 === 2) {
|
|
c3 = 3;
|
|
const obj8 = { value, done: true };
|
|
return obj8;
|
|
} else {
|
|
c2 = 2;
|
|
c3 = 1;
|
|
const obj9 = { value: closure_129_0(closure_129_2[15]).uploadContacts("[]", true), done: false };
|
|
return obj9;
|
|
}
|
|
} else if (arg0 === 1) {
|
|
c3 = 3;
|
|
throw value;
|
|
} else if (arg0 === 2) {
|
|
c3 = 3;
|
|
const obj = { value, done: true };
|
|
return obj;
|
|
} else {
|
|
c3 = 3;
|
|
return { value: "HermesInternal", done: null };
|
|
}
|
|
} catch (tmp25) {
|
|
c3 = tmp;
|
|
throw tmp25;
|
|
}
|
|
}
|
|
};
|
|
const ContactSyncModalStore = fn(12747);
|
|
({ setAllowEmail: closure_4, setAllowSync: hasOwnProperty, setName: metroRequire, useContactSyncModalStore: closure_7 } = ContactSyncModalStore);
|
|
let closure_10 = fn(12775).NUF_DISCOVERABILITY_MODAL_KEY;
|
|
const PlatformTypes = fn(1074).PlatformTypes;
|
|
let closure_12 = fn(7030).IN_APP_GUILD_TEMPLATES_MODAL_KEY;
|
|
const size = fn(2);
|
|
let result = size.fileFinishedImporting("modules/nuf/native/NUFActionCreators.tsx");
|
|
|
|
export const startOnboarding = function startOnboarding() {
|
|
DispatcherDefault.dispatch({ type: "ONBOARDING_START" });
|
|
};
|
|
export const nextOnboardingStep = function nextOnboardingStep(skip) {
|
|
let flag = skip.skip;
|
|
if (flag === undefined) {
|
|
flag = false;
|
|
}
|
|
let flag2 = skip.skipAttempt;
|
|
if (flag2 === undefined) {
|
|
flag2 = false;
|
|
}
|
|
DispatcherDefault.dispatch({ type: "ONBOARDING_STEP", skip: flag, skipAttempt: flag2 });
|
|
};
|
|
export const previousOnboardingStep = function previousOnboardingStep() {
|
|
DispatcherDefault.dispatch({ type: "ONBOARDING_STEP", back: true });
|
|
};
|
|
export const transitionToNUFGuildTemplatesModal = function transitionToNUFGuildTemplatesModal(SLIDE_IN) {
|
|
closure_0 = SLIDE_IN;
|
|
ModalActionCreatorsDefault.pushLazy(asyncGeneratorStep(async () => {
|
|
closure_1 = tmp5;
|
|
await tmp2(paths[10])(paths[9], paths.paths);
|
|
closure_128_0 = arg1.default;
|
|
closure_128_0.modalConfig = { animation: closure_129_0 };
|
|
return closure_128_0;
|
|
}), {}, closure_12);
|
|
};
|
|
export const transitionToHubEmailConnectionModal = function transitionToHubEmailConnectionModal(SLIDE_IN, arg1) {
|
|
let flag = arg1;
|
|
if (arg1 === undefined) {
|
|
flag = false;
|
|
}
|
|
HubEmailConnectionModalActionCreatorsDefault.open({
|
|
onCloseExtra(arg0) {
|
|
if (arg0) {
|
|
const result = nuf_NUFActionCreators.setNewUserFlowCompleted();
|
|
} else {
|
|
DispatcherDefault.dispatch({ type: "ONBOARDING_STEP" });
|
|
}
|
|
},
|
|
displayStudentPrompt: flag
|
|
}, SLIDE_IN);
|
|
};
|
|
export const openDiscoverabilityModal = function openDiscoverabilityModal() {
|
|
ModalActionCreatorsDefault.pushLazy(asyncGeneratorStep(async () => {
|
|
closure_1 = tmp5;
|
|
closure_0 = tmp2;
|
|
await require("asyncRequireImpl")(paths[13], paths.paths);
|
|
closure_128_0 = arg1.default;
|
|
closure_128_0.modalConfig = { animation: closure_129_0(closure_129_2[14]).ModalAnimation.SLIDE_IN_OUT };
|
|
return closure_128_0;
|
|
}), {}, closure_10);
|
|
};
|
|
export const closeDiscoverabilityModal = function closeDiscoverabilityModal(skip) {
|
|
ModalActionCreatorsDefault.popWithKey(closure_10);
|
|
DispatcherDefault.dispatch({ type: "ONBOARDING_STEP", skip });
|
|
};
|
|
export const startContactSyncForDiscoverability = function startContactSyncForDiscoverability() {
|
|
const self = this;
|
|
const apply = closure_13.apply;
|
|
if (typeof apply === "unknown") {
|
|
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
|
|
} else {
|
|
applyArgumentsResult = apply(self, arguments);
|
|
}
|
|
return applyArgumentsResult;
|
|
};
|
|
export const toggleDiscoverabilityForUser = function toggleDiscoverabilityForUser() {
|
|
const currentUser = UserStore.getCurrentUser();
|
|
let phone;
|
|
if (currentUser != null) {
|
|
phone = currentUser.phone;
|
|
}
|
|
state = state.getState();
|
|
if (null != phone) {
|
|
hasOwnProperty(!tmp4);
|
|
} else {
|
|
hasOwnProperty(false);
|
|
if (!tmp4) {
|
|
React4(true);
|
|
}
|
|
}
|
|
};
|